类 GeminiChatModel.Builder

java.lang.Object
io.agentscope.core.model.GeminiChatModel.Builder
封闭类:
GeminiChatModel

public static class GeminiChatModel.Builder extends Object
Builder for creating GeminiChatModel instances.
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • apiKey

      public GeminiChatModel.Builder apiKey(String apiKey)
      Sets the API key (for Gemini API).
      参数:
      apiKey - the Gemini API key
      返回:
      this builder
    • baseUrl

      public GeminiChatModel.Builder baseUrl(String baseUrl)
      Sets the custom base URL (for Gemini API).
      参数:
      baseUrl - the custom Gemini API base URL
      返回:
      this builder
    • modelName

      public GeminiChatModel.Builder modelName(String modelName)
      Sets the model name.
      参数:
      modelName - the model name (default: "gemini-2.5-flash")
      返回:
      this builder
    • streamEnabled

      public GeminiChatModel.Builder streamEnabled(boolean streamEnabled)
      Sets whether streaming is enabled.
      参数:
      streamEnabled - true to enable streaming (default: false)
      返回:
      this builder
    • project

      public GeminiChatModel.Builder project(String project)
      Sets the Google Cloud project ID (for Vertex AI).
      参数:
      project - the project ID
      返回:
      this builder
    • location

      public GeminiChatModel.Builder location(String location)
      Sets the Google Cloud location (for Vertex AI).
      参数:
      location - the location (e.g., "us-central1")
      返回:
      this builder
    • vertexAI

      public GeminiChatModel.Builder vertexAI(boolean vertexAI)
      Sets whether to use Vertex AI APIs.
      参数:
      vertexAI - true to use Vertex AI, false for Gemini API
      返回:
      this builder
    • httpOptions

      public GeminiChatModel.Builder httpOptions(com.google.genai.types.HttpOptions httpOptions)
      Sets the HTTP options for the client.
      参数:
      httpOptions - the HTTP options
      返回:
      this builder
    • credentials

      public GeminiChatModel.Builder credentials(com.google.auth.oauth2.GoogleCredentials credentials)
      Sets the Google credentials (for Vertex AI).
      参数:
      credentials - the Google credentials
      返回:
      this builder
    • clientOptions

      public GeminiChatModel.Builder clientOptions(com.google.genai.types.ClientOptions clientOptions)
      Sets the client options.
      参数:
      clientOptions - the client options
      返回:
      this builder
    • defaultOptions

      public GeminiChatModel.Builder defaultOptions(GenerateOptions defaultOptions)
      Sets the default generation options.
      参数:
      defaultOptions - the default options
      返回:
      this builder
    • formatter

      public GeminiChatModel.Builder formatter(Formatter<com.google.genai.types.Content,com.google.genai.types.GenerateContentResponse,com.google.genai.types.GenerateContentConfig.Builder> formatter)
      Sets the formatter.
      参数:
      formatter - the formatter to use
      返回:
      this builder
    • build

      public GeminiChatModel build()
      Builds the GeminiChatModel instance.
      返回:
      a new GeminiChatModel