BasePublisherModel

abstract class BasePublisherModel(val name: String) : Model

Java-friendly base for implementing a Model. A Java subclass overrides generateContentJava, which returns a Reactive Streams Publisher; this base adapts it to the Flow-returning generateContent contract that Java cannot express. Both the unary and streaming cases flow through that one method, exactly as they do for a Kotlin Model; a subclass that supports live connections also overrides connectAsync.

Constructors

Link copied to clipboard
constructor(name: String)

Properties

Link copied to clipboard

The optional features this model supports, which change how ADK builds its requests. By default only a model whose name is a gemini-2.* name lacks LlmCapabilities.outputSchemaAndTools. Override this to choose, for example LlmCapabilities(outputSchemaAndTools = false) to get the final answer through set_model_response beside tools.

Link copied to clipboard
override val name: String

The name of the model.

Functions

Link copied to clipboard
suspend override fun connect(request: LlmRequest): LiveConnection

Opens a live (bidirectional streaming) connection, configured by LlmRequest.liveConnectConfig.

Link copied to clipboard
override fun generateContent(request: LlmRequest, stream: Boolean = false): Flow<LlmResponse>

Generates content for the given LlmRequest. This returns a Flow of LlmResponses.