Interface ChatModel

All Superinterfaces:
Model<Prompt,ChatResponse>, StreamingChatModel, StreamingModel<Prompt,ChatResponse>
All Known Implementing Classes:
AnthropicChatModel, BedrockProxyChatModel, DeepSeekChatModel, GoogleGenAiChatModel, MistralAiChatModel, OllamaChatModel, OpenAiChatModel

public interface ChatModel extends Model<Prompt,ChatResponse>, StreamingChatModel
  • Method Details

    • call

      default @Nullable String call(String message)
    • call

      default @Nullable String call(Message... messages)
    • call

      ChatResponse call(Prompt prompt)
      Description copied from interface: Model
      Executes a method call to the AI model.
      Specified by:
      call in interface Model<Prompt,ChatResponse>
      Parameters:
      prompt - the request object to be sent to the AI model
      Returns:
      the response from the AI model
    • getOptions

      default ChatOptions getOptions()
      Gets the chat options for this model.
      Returns:
      the chat options
      Since:
      2.0.0
    • getDefaultOptions

      @Deprecated(forRemoval=true) default ChatOptions getDefaultOptions()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getOptions() instead.
    • stream

      default reactor.core.publisher.Flux<ChatResponse> stream(Prompt prompt)
      Description copied from interface: StreamingModel
      Executes a method call to the AI model.
      Specified by:
      stream in interface StreamingChatModel
      Specified by:
      stream in interface StreamingModel<Prompt,ChatResponse>
      Parameters:
      prompt - the request object to be sent to the AI model
      Returns:
      the streaming response from the AI model
    • buildRequestPrompt

      default Prompt buildRequestPrompt(Prompt prompt)