类名:ApigeeLlm

java.lang.Object
com.google.adk.models.BaseLlm
com.google.adk.models.ApigeeLlm

public class ApigeeLlm extends BaseLlm
A BaseLlm 用于调用 Apigee 代理的实现方式。

这个类允许通过 Apigee 代理来路由请求。该模型字符串格式支持指定提供商(Gemini 或 Vertex AI)、API 版本以及模型 ID。

  • 嵌套类概述

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    定义了 Apigee 代理将使用的 API 类型。
    static class 
    “Builder for”是一个用于描述某种构建工具或框架的术语。它通常表示该工具/框架用于帮助开发者或系统管理员快速、高效地创建或构建特定类型的应用程序、系统或组件。例如:“Builder for Web Applications”(用于构建Web应用程序的工具)或“Builder for Cloud Services”(用于构建云服务的工具)。 ApigeeLlm.
  • 方法概述

    Modifier and Type
    Method
    Description
    返回一个新的 `Builder` 对象,用于构建(或创建)某个对象。 ApigeeLlm instances.
    返回 Gemini 代理的功能(这些功能取决于其后端服务);如果后端服务未提供相应功能,则使用聊天完成(chat completion)端点的默认设置。
    connect(LlmRequest llmRequest)
    创建与大型语言模型(LLM)的实时连接。
    io.reactivex.rxjava3.core.Flowable<LlmResponse>
    generateContent(LlmRequest llmRequest, boolean stream)
    根据给定的大型语言模型(LLM)请求及相关工具,生成一条内容。

    Methods inherited from class BaseLlm

    model
    Modifier and Type
    Method
    Description
    返回大型语言模型(LLM)的名称。

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 方法详细信息(Method Details)

    • builder

      public static ApigeeLlm.Builder builder()
      返回一个新的 `Builder` 对象,用于构建(或创建)某个对象。 ApigeeLlm instances.
      Returns:
      a new ApigeeLlm.Builder
    • generateContent

      public io.reactivex.rxjava3.core.Flowable<LlmResponse> generateContent(LlmRequest llmRequest, boolean stream)
      描述内容复制自相关类: BaseLlm
      根据给定的大型语言模型(LLM)请求及相关工具,生成一条内容。
      Specified by:
      generateContent in class BaseLlm
      Parameters:
      llmRequest - The LLM request containing the input prompt and parameters.
      stream - A boolean flag indicating whether to stream the response.
      Returns:
      A Flowable of LlmResponses. For non-streaming calls, it will only yield one LlmResponse. For streaming calls, it may yield more than one LlmResponse, but all yielded LlmResponses should be treated as one content by merging their parts.
    • connect

      public BaseLlmConnection connect(LlmRequest llmRequest)
      描述内容复制自相关类: BaseLlm
      创建与大型语言模型(LLM)的实时连接。
      Specified by:
      connect in class BaseLlm
    • capabilities

      public LlmCapabilities capabilities()
      返回 Gemini 代理的功能(这些功能取决于其后端服务);如果后端服务未提供相应功能,则使用聊天完成(chat completion)端点的默认设置。
      Overrides:
      capabilities in class BaseLlm