Base发布者(Publisher)模型

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

该模型支持一些可选功能,这些功能会改变 ADK(Android Development Kit)生成请求的方式。默认情况下,只有某些特定模型的才能使用这些可选功能。 名称 是一个 gemini-2.* 名称不完整(或缺少某些信息)。 LlmCapabilities.outputSchemaAndTools. 如果需要更改默认设置,可以覆盖此选项(例如)。 LlmCapabilities(outputSchemaAndTools = false) 为了得到最终的答案…… set_model_response 除了这些工具之外……

Link copied to clipboard
override val name: String

模型的名称。

函数

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

建立一条实时(双向流传输)连接,该连接的配置由用户自行完成。 LlmRequest.liveConnectConfig.

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

为给定的内容生成相应的内容。 LlmRequest这会返回一个结果。 Flow 的 LlmResponses.