Class ZhiPuAiChatModel

java.lang.Object
org.springframework.ai.chat.model.AbstractToolCallSupport
org.springframework.ai.zhipuai.ZhiPuAiChatModel
All Implemented Interfaces:
ChatModel, StreamingChatModel, Model<Prompt,ChatResponse>, StreamingModel<Prompt,ChatResponse>

public class ZhiPuAiChatModel extends AbstractToolCallSupport implements ChatModel, StreamingChatModel
ChatModel and StreamingChatModel implementation for ZhiPuAI backed by ZhiPuAiApi.
Since:
1.0.0 M1
Author:
Geng Rong
See Also:
  • Field Details

    • retryTemplate

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

    • ZhiPuAiChatModel

      public ZhiPuAiChatModel(ZhiPuAiApi zhiPuAiApi)
      Creates an instance of the ZhiPuAiChatModel.
      Parameters:
      zhiPuAiApi - The ZhiPuAiApi instance to be used for interacting with the ZhiPuAI Chat API.
      Throws:
      IllegalArgumentException - if zhiPuAiApi is null
    • ZhiPuAiChatModel

      public ZhiPuAiChatModel(ZhiPuAiApi zhiPuAiApi, ZhiPuAiChatOptions options)
      Initializes an instance of the ZhiPuAiChatModel.
      Parameters:
      zhiPuAiApi - The ZhiPuAiApi instance to be used for interacting with the ZhiPuAI Chat API.
      options - The ZhiPuAiChatOptions to configure the chat model.
    • ZhiPuAiChatModel

      public ZhiPuAiChatModel(ZhiPuAiApi zhiPuAiApi, ZhiPuAiChatOptions options, FunctionCallbackContext functionCallbackContext, org.springframework.retry.support.RetryTemplate retryTemplate)
      Initializes an instance of the ZhiPuAiChatModel.
      Parameters:
      zhiPuAiApi - The ZhiPuAiApi instance to be used for interacting with the ZhiPuAI Chat API.
      options - The ZhiPuAiChatOptions to configure the chat model.
      functionCallbackContext - The function callback context.
      retryTemplate - The retry template.
    • ZhiPuAiChatModel

      public ZhiPuAiChatModel(ZhiPuAiApi zhiPuAiApi, ZhiPuAiChatOptions options, FunctionCallbackContext functionCallbackContext, List<FunctionCallback> toolFunctionCallbacks, org.springframework.retry.support.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry)
      Initializes a new instance of the ZhiPuAiChatModel.
      Parameters:
      zhiPuAiApi - The ZhiPuAiApi instance to be used for interacting with the ZhiPuAI Chat API.
      options - The ZhiPuAiChatOptions to configure the chat model.
      functionCallbackContext - The function callback context.
      toolFunctionCallbacks - The tool function callbacks.
      retryTemplate - The retry template.
      observationRegistry - The ObservationRegistry used for instrumentation.
  • Method Details