Class OpenAiChatOptions

java.lang.Object
org.springframework.ai.openai.OpenAiChatOptions
All Implemented Interfaces:
ChatOptions, FunctionCallingOptions, ModelOptions

public class OpenAiChatOptions extends Object implements FunctionCallingOptions, ChatOptions
Since:
0.8.0
Author:
Christian Tzolov
  • Constructor Details

    • OpenAiChatOptions

      public OpenAiChatOptions()
  • Method Details

    • builder

      public static OpenAiChatOptions.Builder builder()
    • getModel

      public String getModel()
    • setModel

      public void setModel(String model)
    • getFrequencyPenalty

      public Float getFrequencyPenalty()
    • setFrequencyPenalty

      public void setFrequencyPenalty(Float frequencyPenalty)
    • getLogitBias

      public Map<String,Integer> getLogitBias()
    • setLogitBias

      public void setLogitBias(Map<String,Integer> logitBias)
    • getMaxTokens

      public Integer getMaxTokens()
    • setMaxTokens

      public void setMaxTokens(Integer maxTokens)
    • getN

      public Integer getN()
    • setN

      public void setN(Integer n)
    • getPresencePenalty

      public Float getPresencePenalty()
    • setPresencePenalty

      public void setPresencePenalty(Float presencePenalty)
    • getResponseFormat

    • setResponseFormat

      public void setResponseFormat(OpenAiApi.ChatCompletionRequest.ResponseFormat responseFormat)
    • getSeed

      public Integer getSeed()
    • setSeed

      public void setSeed(Integer seed)
    • getStop

      public List<String> getStop()
    • setStop

      public void setStop(List<String> stop)
    • getTemperature

      public Float getTemperature()
      Specified by:
      getTemperature in interface ChatOptions
    • setTemperature

      public void setTemperature(Float temperature)
    • getTopP

      public Float getTopP()
      Specified by:
      getTopP in interface ChatOptions
    • setTopP

      public void setTopP(Float topP)
    • getTools

      public List<OpenAiApi.FunctionTool> getTools()
    • setTools

      public void setTools(List<OpenAiApi.FunctionTool> tools)
    • getToolChoice

      public String getToolChoice()
    • setToolChoice

      public void setToolChoice(String toolChoice)
    • getUser

      public String getUser()
    • setUser

      public void setUser(String user)
    • getFunctionCallbacks

      public List<FunctionCallback> getFunctionCallbacks()
      Description copied from interface: FunctionCallingOptions
      Function Callbacks to be registered with the ChatClient. For Prompt Options the functionCallbacks are automatically enabled for the duration of the prompt execution. For Default Options the FunctionCallbacks are registered but disabled by default. You have to use "functions" property to list the function names from the ChatClient registry to be used in the chat completion requests.
      Specified by:
      getFunctionCallbacks in interface FunctionCallingOptions
      Returns:
      Return the Function Callbacks to be registered with the ChatClient.
    • setFunctionCallbacks

      public void setFunctionCallbacks(List<FunctionCallback> functionCallbacks)
      Description copied from interface: FunctionCallingOptions
      Set the Function Callbacks to be registered with the ChatClient.
      Specified by:
      setFunctionCallbacks in interface FunctionCallingOptions
      Parameters:
      functionCallbacks - the Function Callbacks to be registered with the ChatClient.
    • getFunctions

      public Set<String> getFunctions()
      Specified by:
      getFunctions in interface FunctionCallingOptions
      Returns:
      List of function names from the ChatClient registry to be used in the next chat completion requests.
    • setFunctions

      public void setFunctions(Set<String> functionNames)
      Description copied from interface: FunctionCallingOptions
      Set the list of function names from the ChatClient registry to be used in the next chat completion requests.
      Specified by:
      setFunctions in interface FunctionCallingOptions
      Parameters:
      functionNames - the list of function names from the ChatClient registry to be used in the next chat completion requests.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getTopK

      public Integer getTopK()
      Specified by:
      getTopK in interface ChatOptions
    • setTopK

      public void setTopK(Integer topK)