Class AzureOpenAiChatOptions

java.lang.Object
org.springframework.ai.azure.openai.AzureOpenAiChatOptions
All Implemented Interfaces:
ChatOptions, ModelOptions, ToolCallingChatOptions

public class AzureOpenAiChatOptions extends Object implements ToolCallingChatOptions
The configuration information for a chat completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.
Author:
Christian Tzolov, Thomas Vitale, Soby Chacko, Ilayaperumal Gopinathan, Alexandros Pappas, Andres da Silva Santos
  • Constructor Details

    • AzureOpenAiChatOptions

      public AzureOpenAiChatOptions()
  • Method Details

    • getToolCallbacks

      public List<ToolCallback> getToolCallbacks()
      Description copied from interface: ToolCallingChatOptions
      ToolCallbacks to be registered with the ChatModel.
      Specified by:
      getToolCallbacks in interface ToolCallingChatOptions
    • setToolCallbacks

      public void setToolCallbacks(List<ToolCallback> toolCallbacks)
      Description copied from interface: ToolCallingChatOptions
      Set the ToolCallbacks to be registered with the ChatModel.
      Specified by:
      setToolCallbacks in interface ToolCallingChatOptions
    • getToolNames

      public Set<String> getToolNames()
      Description copied from interface: ToolCallingChatOptions
      Names of the tools to register with the ChatModel.
      Specified by:
      getToolNames in interface ToolCallingChatOptions
    • setToolNames

      public void setToolNames(Set<String> toolNames)
      Description copied from interface: ToolCallingChatOptions
      Set the names of the tools to register with the ChatModel.
      Specified by:
      setToolNames in interface ToolCallingChatOptions
    • getInternalToolExecutionEnabled

      @Nullable public Boolean getInternalToolExecutionEnabled()
      Description copied from interface: ToolCallingChatOptions
      Whether the ChatModel is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.
      Specified by:
      getInternalToolExecutionEnabled in interface ToolCallingChatOptions
    • setInternalToolExecutionEnabled

      public void setInternalToolExecutionEnabled(@Nullable Boolean internalToolExecutionEnabled)
      Description copied from interface: ToolCallingChatOptions
      Set whether the ChatModel is responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.
      Specified by:
      setInternalToolExecutionEnabled in interface ToolCallingChatOptions
    • builder

      public static AzureOpenAiChatOptions.Builder builder()
    • fromOptions

      public static AzureOpenAiChatOptions fromOptions(AzureOpenAiChatOptions fromOptions)
    • getMaxTokens

      public Integer getMaxTokens()
      Description copied from interface: ChatOptions
      Returns the maximum number of tokens to use for the chat.
      Specified by:
      getMaxTokens in interface ChatOptions
      Returns:
      the maximum number of tokens to use for the chat
    • setMaxTokens

      public void setMaxTokens(Integer maxTokens)
    • getMaxCompletionTokens

      public Integer getMaxCompletionTokens()
    • setMaxCompletionTokens

      public void setMaxCompletionTokens(Integer maxCompletionTokens)
    • getLogitBias

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

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

      public String getUser()
    • setUser

      public void setUser(String user)
    • getN

      public Integer getN()
    • setN

      public void setN(Integer n)
    • getStopSequences

      public List<String> getStopSequences()
      Description copied from interface: ChatOptions
      Returns the stop sequences to use for the chat.
      Specified by:
      getStopSequences in interface ChatOptions
      Returns:
      the stop sequences to use for the chat
    • setStopSequences

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

      public List<String> getStop()
    • setStop

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

      public Double getPresencePenalty()
      Description copied from interface: ChatOptions
      Returns the presence penalty to use for the chat.
      Specified by:
      getPresencePenalty in interface ChatOptions
      Returns:
      the presence penalty to use for the chat
    • setPresencePenalty

      public void setPresencePenalty(Double presencePenalty)
    • getFrequencyPenalty

      public Double getFrequencyPenalty()
      Description copied from interface: ChatOptions
      Returns the frequency penalty to use for the chat.
      Specified by:
      getFrequencyPenalty in interface ChatOptions
      Returns:
      the frequency penalty to use for the chat
    • setFrequencyPenalty

      public void setFrequencyPenalty(Double frequencyPenalty)
    • getModel

      public String getModel()
      Description copied from interface: ChatOptions
      Returns the model to use for the chat.
      Specified by:
      getModel in interface ChatOptions
      Returns:
      the model to use for the chat
    • setModel

      public void setModel(String model)
    • getDeploymentName

      public String getDeploymentName()
    • setDeploymentName

      public void setDeploymentName(String deploymentName)
    • getTemperature

      public Double getTemperature()
      Description copied from interface: ChatOptions
      Returns the temperature to use for the chat.
      Specified by:
      getTemperature in interface ChatOptions
      Returns:
      the temperature to use for the chat
    • setTemperature

      public void setTemperature(Double temperature)
    • getTopP

      public Double getTopP()
      Description copied from interface: ChatOptions
      Returns the top P to use for the chat.
      Specified by:
      getTopP in interface ChatOptions
      Returns:
      the top P to use for the chat
    • setTopP

      public void setTopP(Double topP)
    • setFunctions

      public void setFunctions(Set<String> functions)
    • getResponseFormat

      public AzureOpenAiResponseFormat getResponseFormat()
    • setResponseFormat

      public void setResponseFormat(AzureOpenAiResponseFormat responseFormat)
    • getStreamUsage

      public Boolean getStreamUsage()
    • setStreamUsage

      public void setStreamUsage(Boolean enableStreamUsage)
    • getReasoningEffort

      public String getReasoningEffort()
    • setReasoningEffort

      public void setReasoningEffort(String reasoningEffort)
    • getTopK

      public Integer getTopK()
      Description copied from interface: ChatOptions
      Returns the top K to use for the chat.
      Specified by:
      getTopK in interface ChatOptions
      Returns:
      the top K to use for the chat
    • getSeed

      public Long getSeed()
    • setSeed

      public void setSeed(Long seed)
    • isLogprobs

      public Boolean isLogprobs()
    • setLogprobs

      public void setLogprobs(Boolean logprobs)
    • getTopLogProbs

      public Integer getTopLogProbs()
    • setTopLogProbs

      public void setTopLogProbs(Integer topLogProbs)
    • getEnhancements

      public com.azure.ai.openai.models.AzureChatEnhancementConfiguration getEnhancements()
    • setEnhancements

      public void setEnhancements(com.azure.ai.openai.models.AzureChatEnhancementConfiguration enhancements)
    • getToolContext

      public Map<String,Object> getToolContext()
      Description copied from interface: ToolCallingChatOptions
      Get the configured tool context.
      Specified by:
      getToolContext in interface ToolCallingChatOptions
      Returns:
      the tool context map.
    • setToolContext

      public void setToolContext(Map<String,Object> toolContext)
      Description copied from interface: ToolCallingChatOptions
      Set the tool context values as map.
      Specified by:
      setToolContext in interface ToolCallingChatOptions
      Parameters:
      toolContext - as map
    • getStreamOptions

      public com.azure.ai.openai.models.ChatCompletionStreamOptions getStreamOptions()
    • setStreamOptions

      public void setStreamOptions(com.azure.ai.openai.models.ChatCompletionStreamOptions streamOptions)
    • copy

      public AzureOpenAiChatOptions copy()
      Description copied from interface: ChatOptions
      Returns a copy of this ChatOptions.
      Specified by:
      copy in interface ChatOptions
      Returns:
      a copy of this ChatOptions
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object