接口 Model

所有已知实现类:
AnthropicChatModel, ChatModelBase, DashScopeChatModel, GeminiChatModel, OllamaChatModel, OpenAIChatModel

public interface Model
  • 方法详细资料

    • stream

      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.
      参数:
      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
    • getModelName

      String getModelName()
      Get model name for logging and identification.
      返回:
      model name
    • supportsNativeStructuredOutput

      default boolean supportsNativeStructuredOutput()
      Whether this model supports native structured output (response_format with json_schema) alongside tool use. When true, the agent can pass the output schema directly to the model via GenerateOptions.getResponseFormat() instead of injecting a synthetic generate_response tool.
      返回:
      true if the model supports structured output with tools natively