类 OllamaChatModel.Builder
java.lang.Object
io.agentscope.core.model.OllamaChatModel.Builder
- 封闭类:
OllamaChatModel
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明build()defaultOptions(OllamaOptions defaultOptions) formatter(Formatter<OllamaMessage, OllamaResponse, OllamaRequest> formatter) httpTransport(HttpTransport httpTransport) Sets the HTTP transport to use.proxy(ProxyConfig proxyConfig) Sets the proxy configuration for HTTP traffic.
-
构造器详细资料
-
Builder
public Builder()
-
-
方法详细资料
-
modelName
-
baseUrl
-
defaultOptions
-
formatter
public OllamaChatModel.Builder formatter(Formatter<OllamaMessage, OllamaResponse, OllamaRequest> formatter) -
httpTransport
Sets the HTTP transport to use.Note on proxy configuration: Because
httpTransportis 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 callinghttpTransport(), for simple proxy-only customization. - Configure the proxy directly within the transport's
HttpTransportConfigwhen building the transport instance.
If both
httpTransport()andproxy()are called,httpTransport()takes full precedence andproxy()is ignored (a warning is logged at build time).- 参数:
httpTransport- the HTTP transport (null for default from factory)- 返回:
- this builder instance
- Use
-
proxy
Sets the proxy configuration for HTTP traffic.Interaction with
httpTransport(HttpTransport): BecausehttpTransportis 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 defaultOkHttpTransportis 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 ownHttpTransportConfig). - If both are called:
httpTransport()takes full precedence. Theproxy()setting is ignored and a warning is logged. To configure proxy with a custom transport, set it within the transport'sHttpTransportConfigdirectly. - If neither is called: the default transport from
HttpTransportFactoryis used (no proxy).
- 参数:
proxyConfig- the proxy configuration (seeProxyConfig)- 返回:
- this builder instance
- If only
-
build
-