Class QianFanChatModel

java.lang.Object
org.springframework.ai.qianfan.QianFanChatModel
All Implemented Interfaces:
ChatModel, StreamingChatModel, Model<Prompt,ChatResponse>, StreamingModel<Prompt,ChatResponse>

public class QianFanChatModel extends Object implements ChatModel, StreamingChatModel
ChatModel and StreamingChatModel implementation for QianFan backed by QianFanApi.
Since:
1.0
Author:
Geng Rong
See Also:
  • Field Details

    • retryTemplate

      public final org.springframework.retry.support.RetryTemplate retryTemplate
      The retry template used to retry the QianFan API calls.
  • Constructor Details

    • QianFanChatModel

      public QianFanChatModel(QianFanApi qianFanApi)
      Creates an instance of the QianFanChatModel.
      Parameters:
      qianFanApi - The QianFanApi instance to be used for interacting with the QianFan Chat API.
      Throws:
      IllegalArgumentException - if QianFanApi is null
    • QianFanChatModel

      public QianFanChatModel(QianFanApi qianFanApi, QianFanChatOptions options)
      Initializes an instance of the QianFanChatModel.
      Parameters:
      qianFanApi - The QianFanApi instance to be used for interacting with the QianFan Chat API.
      options - The QianFanChatOptions to configure the chat client.
    • QianFanChatModel

      public QianFanChatModel(QianFanApi qianFanApi, QianFanChatOptions options, org.springframework.retry.support.RetryTemplate retryTemplate)
      Initializes a new instance of the QianFanChatModel.
      Parameters:
      qianFanApi - The QianFanApi instance to be used for interacting with the QianFan Chat API.
      options - The QianFanChatOptions to configure the chat client.
      retryTemplate - The retry template.
    • QianFanChatModel

      public QianFanChatModel(QianFanApi qianFanApi, QianFanChatOptions options, org.springframework.retry.support.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry)
      Initializes a new instance of the QianFanChatModel.
      Parameters:
      qianFanApi - The QianFanApi instance to be used for interacting with the QianFan Chat API.
      options - The QianFanChatOptions to configure the chat client.
      retryTemplate - The retry template.
      observationRegistry - The ObservationRegistry used for instrumentation.
  • Method Details