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, Mariusz Bernacki, Thomas Vitale
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OpenAiChatOptions.Builder
builder()
copy()
boolean
static OpenAiChatOptions
fromOptions
(OpenAiChatOptions fromOptions) Function Callbacks to be registered with the ChatModel.getModel()
getN()
getSeed()
getStop()
getTools()
getTopK()
getTopP()
getUser()
int
hashCode()
void
setFrequencyPenalty
(Double frequencyPenalty) void
setFunctionCallbacks
(List<FunctionCallback> functionCallbacks) Set the Function Callbacks to be registered with the ChatModel.void
setFunctions
(Set<String> functionNames) Set the list of function names from the ChatModel registry to be used in the next chat completion requests.void
setHttpHeaders
(Map<String, String> httpHeaders) void
setLogitBias
(Map<String, Integer> logitBias) void
setLogprobs
(Boolean logprobs) void
setMaxCompletionTokens
(Integer maxCompletionTokens) void
setMaxTokens
(Integer maxTokens) void
void
void
setParallelToolCalls
(Boolean parallelToolCalls) void
setPresencePenalty
(Double presencePenalty) void
setProxyToolCalls
(Boolean proxyToolCalls) void
setResponseFormat
(OpenAiApi.ChatCompletionRequest.ResponseFormat responseFormat) void
void
void
setStopSequences
(List<String> stopSequences) void
setStreamOptions
(OpenAiApi.ChatCompletionRequest.StreamOptions streamOptions) void
setStreamUsage
(Boolean enableStreamUsage) void
setTemperature
(Double temperature) void
setToolChoice
(String toolChoice) void
setToolContext
(Map<String, Object> toolContext) void
setTools
(List<OpenAiApi.FunctionTool> tools) void
setTopLogprobs
(Integer topLogprobs) void
void
toString()
-
Constructor Details
-
OpenAiChatOptions
public OpenAiChatOptions()
-
-
Method Details
-
builder
- Returns:
- Returns FunctionCallingOptionsBuilder to create a new instance of FunctionCallingOptions.
-
getStreamUsage
-
setStreamUsage
-
getModel
- Specified by:
getModel
in interfaceChatOptions
-
setModel
-
getFrequencyPenalty
- Specified by:
getFrequencyPenalty
in interfaceChatOptions
-
setFrequencyPenalty
-
getLogitBias
-
setLogitBias
-
getLogprobs
-
setLogprobs
-
getTopLogprobs
-
setTopLogprobs
-
getMaxTokens
- Specified by:
getMaxTokens
in interfaceChatOptions
-
setMaxTokens
-
getMaxCompletionTokens
-
setMaxCompletionTokens
-
getN
-
setN
-
getPresencePenalty
- Specified by:
getPresencePenalty
in interfaceChatOptions
-
setPresencePenalty
-
getResponseFormat
-
setResponseFormat
-
getStreamOptions
-
setStreamOptions
-
getSeed
-
setSeed
-
getStopSequences
- Specified by:
getStopSequences
in interfaceChatOptions
-
setStopSequences
-
getStop
-
setStop
-
getTemperature
- Specified by:
getTemperature
in interfaceChatOptions
-
setTemperature
-
getTopP
- Specified by:
getTopP
in interfaceChatOptions
-
setTopP
-
getTools
-
setTools
-
getToolChoice
-
getProxyToolCalls
- Specified by:
getProxyToolCalls
in interfaceFunctionCallingOptions
-
setProxyToolCalls
- Specified by:
setProxyToolCalls
in interfaceFunctionCallingOptions
-
setToolChoice
-
getUser
-
setUser
-
getParallelToolCalls
-
setParallelToolCalls
-
getFunctionCallbacks
Description copied from interface:FunctionCallingOptions
Function Callbacks to be registered with the ChatModel. 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 ChatModel registry to be used in the chat completion requests.- Specified by:
getFunctionCallbacks
in interfaceFunctionCallingOptions
- Returns:
- Return the Function Callbacks to be registered with the ChatModel.
-
setFunctionCallbacks
Description copied from interface:FunctionCallingOptions
Set the Function Callbacks to be registered with the ChatModel.- Specified by:
setFunctionCallbacks
in interfaceFunctionCallingOptions
- Parameters:
functionCallbacks
- the Function Callbacks to be registered with the ChatModel.
-
getFunctions
- Specified by:
getFunctions
in interfaceFunctionCallingOptions
- Returns:
- List of function names from the ChatModel registry to be used in the next chat completion requests.
-
setFunctions
Description copied from interface:FunctionCallingOptions
Set the list of function names from the ChatModel registry to be used in the next chat completion requests.- Specified by:
setFunctions
in interfaceFunctionCallingOptions
- Parameters:
functionNames
- the list of function names from the ChatModel registry to be used in the next chat completion requests.
-
getHttpHeaders
-
setHttpHeaders
-
getTopK
- Specified by:
getTopK
in interfaceChatOptions
-
getToolContext
- Specified by:
getToolContext
in interfaceFunctionCallingOptions
-
setToolContext
- Specified by:
setToolContext
in interfaceFunctionCallingOptions
-
copy
- Specified by:
copy
in interfaceChatOptions
-
fromOptions
-
hashCode
public int hashCode() -
equals
-
toString
-