类 ChatModelBase

java.lang.Object
io.agentscope.core.model.ChatModelBase
所有已实现的接口:
Model
直接已知子类:
AnthropicChatModel, DashScopeChatModel, GeminiChatModel, OllamaChatModel, OpenAIChatModel

public abstract class ChatModelBase extends Object implements Model
Abstract base class for all models in the AgentScope framework.

This class provides common functionality for model including basic model invocation and tracing.

  • 构造器详细资料

    • ChatModelBase

      public ChatModelBase()
  • 方法详细资料

    • stream

      public final reactor.core.publisher.Flux<ChatResponse> stream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options)
      Stream chat completion responses. The model internally handles message formatting using its configured formatter.

      Tracing data will be captured once telemetry is enabled.

      指定者:
      stream 在接口中 Model
      参数:
      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
    • doStream

      protected abstract reactor.core.publisher.Flux<ChatResponse> doStream(List<Msg> messages, List<ToolSchema> tools, GenerateOptions options)
      Internal implementation for streaming chat completion responses. Subclasses must implement their specific logic here.
      参数:
      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