Class QianFanApi

java.lang.Object
org.springframework.ai.qianfan.api.auth.AuthApi
org.springframework.ai.qianfan.api.QianFanApi

public class QianFanApi extends AuthApi
Single class implementation of the QianFan Chat Completion API and Embedding API. QianFan Docs
Since:
1.0
Author:
Geng Rong, Thomas Vitale
  • Field Details

    • DEFAULT_CHAT_MODEL

      public static final String DEFAULT_CHAT_MODEL
    • DEFAULT_EMBEDDING_MODEL

      public static final String DEFAULT_EMBEDDING_MODEL
  • Constructor Details

    • QianFanApi

      public QianFanApi(String apiKey, String secretKey)
      Create a new chat completion api with default base URL.
      Parameters:
      apiKey - QianFan api key.
      secretKey - QianFan secret key.
    • QianFanApi

      public QianFanApi(String baseUrl, String apiKey, String secretKey)
      Create a new chat completion api.
      Parameters:
      baseUrl - api base URL.
      apiKey - QianFan api key.
      secretKey - QianFan secret key.
    • QianFanApi

      public QianFanApi(String baseUrl, String apiKey, String secretKey, org.springframework.web.client.RestClient.Builder restClientBuilder)
      Create a new chat completion api.
      Parameters:
      baseUrl - api base URL.
      apiKey - QianFan api key.
      secretKey - QianFan secret key.
      restClientBuilder - RestClient builder.
    • QianFanApi

      public QianFanApi(String baseUrl, String apiKey, String secretKey, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
      Create a new chat completion api.
      Parameters:
      baseUrl - api base URL.
      apiKey - QianFan api key.
      secretKey - QianFan secret key.
      restClientBuilder - RestClient builder.
      responseErrorHandler - Response error handler.
    • QianFanApi

      public QianFanApi(String baseUrl, String apiKey, String secretKey, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.reactive.function.client.WebClient.Builder webClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
      Create a new chat completion api.
      Parameters:
      baseUrl - api base URL.
      apiKey - QianFan api key.
      secretKey - QianFan secret key.
      restClientBuilder - RestClient builder.
      webClientBuilder - WebClient builder.
      responseErrorHandler - Response error handler.
  • Method Details