类 OllamaChatModel.Builder

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

public static class OllamaChatModel.Builder extends Object
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • modelName

      public OllamaChatModel.Builder modelName(String modelName)
    • baseUrl

      public OllamaChatModel.Builder baseUrl(String baseUrl)
    • defaultOptions

      public OllamaChatModel.Builder defaultOptions(OllamaOptions defaultOptions)
    • formatter

    • httpTransport

      public OllamaChatModel.Builder httpTransport(HttpTransport httpTransport)
      Sets the HTTP transport to use.

      Note on proxy configuration: Because httpTransport is a fully-constructed HTTP client instance, its configuration (including proxy) cannot be modified after creation. If you need to configure a proxy, either:

      • Use proxy(ProxyConfig) without calling httpTransport(), for simple proxy-only customization.
      • Configure the proxy directly within the transport's HttpTransportConfig when building the transport instance.

      If both httpTransport() and proxy() are called, httpTransport() takes full precedence and proxy() is ignored (a warning is logged at build time).

      参数:
      httpTransport - the HTTP transport (null for default from factory)
      返回:
      this builder instance
    • proxy

      public OllamaChatModel.Builder proxy(ProxyConfig proxyConfig)
      Sets the proxy configuration for HTTP traffic.

      Interaction with httpTransport(HttpTransport): Because httpTransport is a fully-constructed HTTP client instance, its configuration cannot be modified after creation. The final transport is determined as follows:

      • If only proxy() is called: the default OkHttpTransport is used with the specified proxy configuration applied.
      • If only httpTransport() is called: the provided transport is used as-is (proxy must be configured within the transport's own HttpTransportConfig).
      • If both are called: httpTransport() takes full precedence. The proxy() setting is ignored and a warning is logged. To configure proxy with a custom transport, set it within the transport's HttpTransportConfig directly.
      • If neither is called: the default transport from HttpTransportFactory is used (no proxy).
      参数:
      proxyConfig - the proxy configuration (see ProxyConfig)
      返回:
      this builder instance
    • build

      public OllamaChatModel build()