类 OpenAIChatModel
java.lang.Object
io.agentscope.core.model.ChatModelBase
io.agentscope.core.model.OpenAIChatModel
- 所有已实现的接口:
Model
OpenAI Chat Model using native HTTP API.
This implementation uses direct HTTP calls to OpenAI-compatible APIs.
Features:
- Streaming and non-streaming modes
- Tool calling support
- Automatic message format conversion
- Timeout and retry configuration
- Multi-provider support via different Formatters
Provider-specific behavior is handled by the Formatter. Use the appropriate formatter for your provider:
OpenAIChatFormatter- Standard OpenAI GPT modelsDeepSeekFormatter- DeepSeek Chat modelsGLMFormatter- Zhipu GLM models
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明static OpenAIChatModel.Builderbuilder()Creates a new builder for OpenAIChatModel.protected reactor.core.publisher.Flux<ChatResponse> doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) Internal implementation for streaming chat completion responses.protected reactor.core.publisher.Flux<ChatResponse> doStream0(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) Gets the model name for logging and identification.从类继承的方法 io.agentscope.core.model.ChatModelBase
stream
-
方法详细资料
-
doStream
protected reactor.core.publisher.Flux<ChatResponse> doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) 从类复制的说明:ChatModelBaseInternal implementation for streaming chat completion responses. Subclasses must implement their specific logic here.- 指定者:
doStream在类中ChatModelBase- 参数:
messages- AgentScope messages to send to the modeltools- Optional list of tool schemas (null or empty if no tools)options- Optional generation options (null to use defaults)- 返回:
- Flux stream of chat responses
-
doStream0
protected reactor.core.publisher.Flux<ChatResponse> doStream0(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options) -
getModelName
Gets the model name for logging and identification.- 返回:
- the model name, or null if not configured
-
builder
Creates a new builder for OpenAIChatModel.- 返回:
- a new Builder instance
-