Class OpenAiChatModel

All Implemented Interfaces:
ChatModel, StreamingChatModel, Model<Prompt,ChatResponse>, StreamingModel<Prompt,ChatResponse>

public class OpenAiChatModel extends AbstractToolCallSupport implements ChatModel
ChatModel and StreamingChatModel implementation for OpenAI backed by OpenAiApi.
Author:
Mark Pollack, Christian Tzolov, Ueibin Kim, John Blum, Josh Long, Jemin Huh, Grogdunn, Hyunjoon Choi, Mariusz Bernacki, luocongqiu, Thomas Vitale, Ilayaperumal Gopinathan, Alexandros Pappas
See Also:
  • Constructor Details

    • OpenAiChatModel

      @Deprecated public OpenAiChatModel(OpenAiApi openAiApi)
      Deprecated.
      Use OpenAiChatModel.Builder.
      Creates an instance of the OpenAiChatModel.
      Parameters:
      openAiApi - The OpenAiApi instance to be used for interacting with the OpenAI Chat API.
      Throws:
      IllegalArgumentException - if openAiApi is null
    • OpenAiChatModel

      @Deprecated public OpenAiChatModel(OpenAiApi openAiApi, OpenAiChatOptions options)
      Deprecated.
      Use OpenAiChatModel.Builder.
      Initializes an instance of the OpenAiChatModel.
      Parameters:
      openAiApi - The OpenAiApi instance to be used for interacting with the OpenAI Chat API.
      options - The OpenAiChatOptions to configure the chat model.
    • OpenAiChatModel

      @Deprecated public OpenAiChatModel(OpenAiApi openAiApi, OpenAiChatOptions options, @Nullable FunctionCallbackResolver functionCallbackResolver, org.springframework.retry.support.RetryTemplate retryTemplate)
      Deprecated.
      Use OpenAiChatModel.Builder.
      Initializes a new instance of the OpenAiChatModel.
      Parameters:
      openAiApi - The OpenAiApi instance to be used for interacting with the OpenAI Chat API.
      options - The OpenAiChatOptions to configure the chat model.
      functionCallbackResolver - The function callback resolver.
      retryTemplate - The retry template.
    • OpenAiChatModel

      @Deprecated public OpenAiChatModel(OpenAiApi openAiApi, OpenAiChatOptions options, @Nullable FunctionCallbackResolver functionCallbackResolver, @Nullable List<FunctionCallback> toolFunctionCallbacks, org.springframework.retry.support.RetryTemplate retryTemplate)
      Deprecated.
      Use OpenAiChatModel.Builder.
      Initializes a new instance of the OpenAiChatModel.
      Parameters:
      openAiApi - The OpenAiApi instance to be used for interacting with the OpenAI Chat API.
      options - The OpenAiChatOptions to configure the chat model.
      functionCallbackResolver - The function callback resolver.
      toolFunctionCallbacks - The tool function callbacks.
      retryTemplate - The retry template.
    • OpenAiChatModel

      @Deprecated public OpenAiChatModel(OpenAiApi openAiApi, OpenAiChatOptions options, @Nullable FunctionCallbackResolver functionCallbackResolver, @Nullable List<FunctionCallback> toolFunctionCallbacks, org.springframework.retry.support.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry)
      Deprecated.
      Use OpenAiChatModel.Builder or OpenAiChatModel(OpenAiApi, OpenAiChatOptions, ToolCallingManager, RetryTemplate, ObservationRegistry).
      Initializes a new instance of the OpenAiChatModel.
      Parameters:
      openAiApi - The OpenAiApi instance to be used for interacting with the OpenAI Chat API.
      options - The OpenAiChatOptions to configure the chat model.
      functionCallbackResolver - The function callback resolver.
      toolFunctionCallbacks - The tool function callbacks.
      retryTemplate - The retry template.
      observationRegistry - The ObservationRegistry used for instrumentation.
    • OpenAiChatModel

      public OpenAiChatModel(OpenAiApi openAiApi, OpenAiChatOptions defaultOptions, ToolCallingManager toolCallingManager, org.springframework.retry.support.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry)
  • Method Details