类 OpenAIChatModel

java.lang.Object
io.agentscope.core.model.ChatModelBase
io.agentscope.core.model.OpenAIChatModel
所有已实现的接口:
Model

public class OpenAIChatModel extends ChatModelBase
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:

  • 方法详细资料

    • doStream

      protected reactor.core.publisher.Flux<ChatResponse> doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options)
      从类复制的说明: ChatModelBase
      Internal implementation for streaming chat completion responses. Subclasses must implement their specific logic here.
      指定者:
      doStream 在类中 ChatModelBase
      参数:
      messages - AgentScope messages to send to the model
      tools - 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

      public String getModelName()
      Gets the model name for logging and identification.
      返回:
      the model name, or null if not configured
    • builder

      public static OpenAIChatModel.Builder builder()
      Creates a new builder for OpenAIChatModel.
      返回:
      a new Builder instance