Class OpenAIChatOptions

java.lang.Object
com.javaaidev.openai.OpenAIChatOptions
All Implemented Interfaces:
org.springframework.ai.chat.prompt.ChatOptions, org.springframework.ai.model.function.FunctionCallingOptions, org.springframework.ai.model.ModelOptions

public class OpenAIChatOptions extends Object implements org.springframework.ai.model.function.FunctionCallingOptions
Options for the OpenAI Chat API.
Since:
0.8.0
Author:
Christian Tzolov, Mariusz Bernacki, Thomas Vitale
  • Constructor Details

    • OpenAIChatOptions

      public OpenAIChatOptions()
  • Method Details

    • builder

      public static OpenAIChatOptions.Builder builder()
    • fromOptions

      public static OpenAIChatOptions fromOptions(OpenAIChatOptions fromOptions)
    • getModel

      public String getModel()
      Specified by:
      getModel in interface org.springframework.ai.chat.prompt.ChatOptions
    • setModel

      public void setModel(String model)
    • getFrequencyPenalty

      public Double getFrequencyPenalty()
      Specified by:
      getFrequencyPenalty in interface org.springframework.ai.chat.prompt.ChatOptions
    • setFrequencyPenalty

      public void setFrequencyPenalty(Double frequencyPenalty)
    • getLogitBias

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

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

      public Boolean getLogprobs()
    • setLogprobs

      public void setLogprobs(Boolean logprobs)
    • getTopLogprobs

      public Integer getTopLogprobs()
    • setTopLogprobs

      public void setTopLogprobs(Integer topLogprobs)
    • getMaxTokens

      public Integer getMaxTokens()
      Specified by:
      getMaxTokens in interface org.springframework.ai.chat.prompt.ChatOptions
    • setMaxTokens

      public void setMaxTokens(Integer maxTokens)
    • getMaxCompletionTokens

      public Integer getMaxCompletionTokens()
    • setMaxCompletionTokens

      public void setMaxCompletionTokens(Integer maxCompletionTokens)
    • getN

      public Integer getN()
    • setN

      public void setN(Integer n)
    • getOutputModalities

      public List<String> getOutputModalities()
    • setOutputModalities

      public void setOutputModalities(List<String> modalities)
    • getPresencePenalty

      public Double getPresencePenalty()
      Specified by:
      getPresencePenalty in interface org.springframework.ai.chat.prompt.ChatOptions
    • setPresencePenalty

      public void setPresencePenalty(Double presencePenalty)
    • getSeed

      public Integer getSeed()
    • setSeed

      public void setSeed(Integer seed)
    • getStopSequences

      public List<String> getStopSequences()
      Specified by:
      getStopSequences in interface org.springframework.ai.chat.prompt.ChatOptions
    • setStopSequences

      public void setStopSequences(List<String> stopSequences)
    • getStop

      public List<String> getStop()
    • setStop

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

      public Double getTemperature()
      Specified by:
      getTemperature in interface org.springframework.ai.chat.prompt.ChatOptions
    • setTemperature

      public void setTemperature(Double temperature)
    • getTopP

      public Double getTopP()
      Specified by:
      getTopP in interface org.springframework.ai.chat.prompt.ChatOptions
    • setTopP

      public void setTopP(Double topP)
    • getToolChoice

      public Object getToolChoice()
    • setToolChoice

      public void setToolChoice(Object toolChoice)
    • getProxyToolCalls

      public Boolean getProxyToolCalls()
      Specified by:
      getProxyToolCalls in interface org.springframework.ai.model.function.FunctionCallingOptions
    • setProxyToolCalls

      public void setProxyToolCalls(Boolean proxyToolCalls)
      Specified by:
      setProxyToolCalls in interface org.springframework.ai.model.function.FunctionCallingOptions
    • getUser

      public String getUser()
    • setUser

      public void setUser(String user)
    • getParallelToolCalls

      public Boolean getParallelToolCalls()
    • setParallelToolCalls

      public void setParallelToolCalls(Boolean parallelToolCalls)
    • getFunctionCallbacks

      public List<org.springframework.ai.model.function.FunctionCallback> getFunctionCallbacks()
      Specified by:
      getFunctionCallbacks in interface org.springframework.ai.model.function.FunctionCallingOptions
    • setFunctionCallbacks

      public void setFunctionCallbacks(List<org.springframework.ai.model.function.FunctionCallback> functionCallbacks)
      Specified by:
      setFunctionCallbacks in interface org.springframework.ai.model.function.FunctionCallingOptions
    • getFunctions

      public Set<String> getFunctions()
      Specified by:
      getFunctions in interface org.springframework.ai.model.function.FunctionCallingOptions
    • setFunctions

      public void setFunctions(Set<String> functionNames)
      Specified by:
      setFunctions in interface org.springframework.ai.model.function.FunctionCallingOptions
    • getHttpHeaders

      public Map<String,String> getHttpHeaders()
    • setHttpHeaders

      public void setHttpHeaders(Map<String,String> httpHeaders)
    • getTopK

      public Integer getTopK()
      Specified by:
      getTopK in interface org.springframework.ai.chat.prompt.ChatOptions
    • getToolContext

      public Map<String,Object> getToolContext()
      Specified by:
      getToolContext in interface org.springframework.ai.model.function.FunctionCallingOptions
    • setToolContext

      public void setToolContext(Map<String,Object> toolContext)
      Specified by:
      setToolContext in interface org.springframework.ai.model.function.FunctionCallingOptions
    • copy

      public OpenAIChatOptions copy()
      Specified by:
      copy in interface org.springframework.ai.chat.prompt.ChatOptions
    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object