Class ZhiPuAiApi

java.lang.Object
org.springframework.ai.zhipuai.api.ZhiPuAiApi

public class ZhiPuAiApi extends Object
Single class implementation of the ZhiPuAI Chat Completion API and ZhiPuAI Embedding API.
Since:
1.0.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

    • ZhiPuAiApi

      public ZhiPuAiApi(String zhiPuAiToken)
      Create a new chat completion api with default base URL.
      Parameters:
      zhiPuAiToken - ZhiPuAI apiKey.
    • ZhiPuAiApi

      public ZhiPuAiApi(String baseUrl, String zhiPuAiToken)
      Create a new chat completion api.
      Parameters:
      baseUrl - api base URL.
      zhiPuAiToken - ZhiPuAI apiKey.
    • ZhiPuAiApi

      public ZhiPuAiApi(String baseUrl, String zhiPuAiToken, org.springframework.web.client.RestClient.Builder restClientBuilder)
      Create a new chat completion api.
      Parameters:
      baseUrl - api base URL.
      zhiPuAiToken - ZhiPuAI apiKey.
      restClientBuilder - RestClient builder.
    • ZhiPuAiApi

      public ZhiPuAiApi(String baseUrl, String zhiPuAiToken, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
      Create a new chat completion api.
      Parameters:
      baseUrl - api base URL.
      zhiPuAiToken - ZhiPuAI apiKey.
      restClientBuilder - RestClient builder.
      responseErrorHandler - Response error handler.
  • Method Details