Package org.springframework.ai.openai
Class OpenAiChatOptions
java.lang.Object
org.springframework.ai.openai.OpenAiChatOptions
- All Implemented Interfaces:
ChatOptions,FunctionCallingOptions,ModelOptions
- Since:
- 0.8.0
- Author:
- Christian Tzolov
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenAiChatOptions.Builderbuilder()booleanFunction Callbacks to be registered with the ChatClient.getModel()getN()getSeed()getStop()getTools()getTopK()getTopP()getUser()inthashCode()voidsetFrequencyPenalty(Float frequencyPenalty) voidsetFunctionCallbacks(List<FunctionCallback> functionCallbacks) Set the Function Callbacks to be registered with the ChatClient.voidsetFunctions(Set<String> functionNames) Set the list of function names from the ChatClient registry to be used in the next chat completion requests.voidsetLogitBias(Map<String, Integer> logitBias) voidsetMaxTokens(Integer maxTokens) voidvoidvoidsetPresencePenalty(Float presencePenalty) voidsetResponseFormat(OpenAiApi.ChatCompletionRequest.ResponseFormat responseFormat) voidvoidvoidsetTemperature(Float temperature) voidsetToolChoice(String toolChoice) voidsetTools(List<OpenAiApi.FunctionTool> tools) voidvoidvoid
-
Constructor Details
-
OpenAiChatOptions
public OpenAiChatOptions()
-
-
Method Details
-
builder
-
getModel
-
setModel
-
getFrequencyPenalty
-
setFrequencyPenalty
-
getLogitBias
-
setLogitBias
-
getMaxTokens
-
setMaxTokens
-
getN
-
setN
-
getPresencePenalty
-
setPresencePenalty
-
getResponseFormat
-
setResponseFormat
-
getSeed
-
setSeed
-
getStop
-
setStop
-
getTemperature
- Specified by:
getTemperaturein interfaceChatOptions
-
setTemperature
-
getTopP
- Specified by:
getTopPin interfaceChatOptions
-
setTopP
-
getTools
-
setTools
-
getToolChoice
-
setToolChoice
-
getUser
-
setUser
-
getFunctionCallbacks
Description copied from interface:FunctionCallingOptionsFunction 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:
getFunctionCallbacksin interfaceFunctionCallingOptions- Returns:
- Return the Function Callbacks to be registered with the ChatClient.
-
setFunctionCallbacks
Description copied from interface:FunctionCallingOptionsSet the Function Callbacks to be registered with the ChatClient.- Specified by:
setFunctionCallbacksin interfaceFunctionCallingOptions- Parameters:
functionCallbacks- the Function Callbacks to be registered with the ChatClient.
-
getFunctions
- Specified by:
getFunctionsin interfaceFunctionCallingOptions- Returns:
- List of function names from the ChatClient registry to be used in the next chat completion requests.
-
setFunctions
Description copied from interface:FunctionCallingOptionsSet the list of function names from the ChatClient registry to be used in the next chat completion requests.- Specified by:
setFunctionsin interfaceFunctionCallingOptions- Parameters:
functionNames- the list of function names from the ChatClient registry to be used in the next chat completion requests.
-
hashCode
public int hashCode() -
equals
-
getTopK
- Specified by:
getTopKin interfaceChatOptions
-
setTopK
-