Package org.springframework.ai.deepseek
Class DeepSeekChatOptions
java.lang.Object
org.springframework.ai.deepseek.DeepSeekChatOptions
- All Implemented Interfaces:
ChatOptions,ModelOptions,ToolCallingChatOptions
Chat completions options for the DeepSeek chat API.
DeepSeek
chat completion
- Author:
- Geng Rong
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic class -
Field Summary
Fields inherited from interface org.springframework.ai.model.tool.ToolCallingChatOptions
DEFAULT_TOOL_EXECUTION_ENABLED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeepSeekChatOptions(String model, @Nullable Double frequencyPenalty, @Nullable Integer maxTokens, @Nullable Double presencePenalty, @Nullable ResponseFormat responseFormat, @Nullable List<String> stop, @Nullable Double temperature, @Nullable Double topP, @Nullable Boolean logprobs, @Nullable Integer topLogprobs, @Nullable List<DeepSeekApi.FunctionTool> tools, @Nullable Object toolChoice, @Nullable Boolean internalToolExecutionEnabled, @Nullable List<ToolCallback> toolCallbacks, @Nullable Set<String> toolNames, @Nullable Map<String, Object> toolContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic DeepSeekChatOptions.Builderbuilder()copy()Returns a copy of thisChatOptions.booleanstatic DeepSeekChatOptionsfromOptions(DeepSeekChatOptions fromOptions) @Nullable DoubleReturns the frequency penalty to use for the chat.@Nullable BooleanWhether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.@Nullable Boolean@Nullable IntegerReturns the maximum number of tokens to use for the chat.getModel()Returns the model to use for the chat.@Nullable DoubleReturns the presence penalty to use for the chat.@Nullable ResponseFormatgetStop()Returns the stop sequences to use for the chat.@Nullable DoubleReturns the temperature to use for the chat.ToolCallbacks to be registered with the ChatModel.@Nullable ObjectGet the configured tool context.Names of the tools to register with the ChatModel.@Nullable List<DeepSeekApi.FunctionTool> getTools()@Nullable IntegergetTopK()Returns the top K to use for the chat.@Nullable Integer@Nullable DoublegetTopP()Returns the top P to use for the chat.inthashCode()mutate()Returns a newChatOptions.Builderinitialized with the values of thisChatOptions.voidsetFrequencyPenalty(@Nullable Double frequencyPenalty) voidsetInternalToolExecutionEnabled(@Nullable Boolean internalToolExecutionEnabled) Set whether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.voidsetLogprobs(@Nullable Boolean logprobs) voidsetMaxTokens(@Nullable Integer maxTokens) voidvoidsetPresencePenalty(@Nullable Double presencePenalty) voidsetResponseFormat(@Nullable ResponseFormat responseFormat) voidvoidsetStopSequences(@Nullable List<String> stopSequences) voidsetTemperature(@Nullable Double temperature) voidsetToolCallbacks(List<ToolCallback> toolCallbacks) Set the ToolCallbacks to be registered with the ChatModel.voidsetToolChoice(@Nullable Object toolChoice) voidsetToolContext(Map<String, Object> toolContext) Set the tool context values as map.voidsetToolNames(Set<String> toolNames) Set the names of the tools to register with the ChatModel.voidsetTools(@Nullable List<DeepSeekApi.FunctionTool> tools) voidsetTopLogprobs(@Nullable Integer topLogprobs) void
-
Constructor Details
-
DeepSeekChatOptions
public DeepSeekChatOptions() -
DeepSeekChatOptions
protected DeepSeekChatOptions(String model, @Nullable Double frequencyPenalty, @Nullable Integer maxTokens, @Nullable Double presencePenalty, @Nullable ResponseFormat responseFormat, @Nullable List<String> stop, @Nullable Double temperature, @Nullable Double topP, @Nullable Boolean logprobs, @Nullable Integer topLogprobs, @Nullable List<DeepSeekApi.FunctionTool> tools, @Nullable Object toolChoice, @Nullable Boolean internalToolExecutionEnabled, @Nullable List<ToolCallback> toolCallbacks, @Nullable Set<String> toolNames, @Nullable Map<String, Object> toolContext)
-
-
Method Details
-
builder
-
getModel
Description copied from interface:ChatOptionsReturns the model to use for the chat.- Specified by:
getModelin interfaceChatOptions- Returns:
- the model to use for the chat
-
setModel
-
getFrequencyPenalty
Description copied from interface:ChatOptionsReturns the frequency penalty to use for the chat.- Specified by:
getFrequencyPenaltyin interfaceChatOptions- Returns:
- the frequency penalty to use for the chat
-
setFrequencyPenalty
-
getMaxTokens
Description copied from interface:ChatOptionsReturns the maximum number of tokens to use for the chat.- Specified by:
getMaxTokensin interfaceChatOptions- Returns:
- the maximum number of tokens to use for the chat
-
setMaxTokens
-
getPresencePenalty
Description copied from interface:ChatOptionsReturns the presence penalty to use for the chat.- Specified by:
getPresencePenaltyin interfaceChatOptions- Returns:
- the presence penalty to use for the chat
-
setPresencePenalty
-
getResponseFormat
-
setResponseFormat
-
getStopSequences
Description copied from interface:ChatOptionsReturns the stop sequences to use for the chat.- Specified by:
getStopSequencesin interfaceChatOptions- Returns:
- the stop sequences to use for the chat
-
setStopSequences
-
getStop
-
setStop
-
getTemperature
Description copied from interface:ChatOptionsReturns the temperature to use for the chat.- Specified by:
getTemperaturein interfaceChatOptions- Returns:
- the temperature to use for the chat
-
setTemperature
-
getTopP
Description copied from interface:ChatOptionsReturns the top P to use for the chat.- Specified by:
getTopPin interfaceChatOptions- Returns:
- the top P to use for the chat
-
setTopP
-
getTools
-
setTools
-
getToolChoice
-
setToolChoice
-
getToolCallbacks
Description copied from interface:ToolCallingChatOptionsToolCallbacks to be registered with the ChatModel.- Specified by:
getToolCallbacksin interfaceToolCallingChatOptions
-
setToolCallbacks
Description copied from interface:ToolCallingChatOptionsSet the ToolCallbacks to be registered with the ChatModel.- Specified by:
setToolCallbacksin interfaceToolCallingChatOptions
-
getToolNames
Description copied from interface:ToolCallingChatOptionsNames of the tools to register with the ChatModel.- Specified by:
getToolNamesin interfaceToolCallingChatOptions
-
setToolNames
Description copied from interface:ToolCallingChatOptionsSet the names of the tools to register with the ChatModel.- Specified by:
setToolNamesin interfaceToolCallingChatOptions
-
getInternalToolExecutionEnabled
Description copied from interface:ToolCallingChatOptionsWhether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.- Specified by:
getInternalToolExecutionEnabledin interfaceToolCallingChatOptions
-
setInternalToolExecutionEnabled
Description copied from interface:ToolCallingChatOptionsSet whether theChatModelis responsible for executing the tools requested by the model or if the tools should be executed directly by the caller.- Specified by:
setInternalToolExecutionEnabledin interfaceToolCallingChatOptions
-
getLogprobs
-
setLogprobs
-
getTopLogprobs
-
setTopLogprobs
-
getTopK
Description copied from interface:ChatOptionsReturns the top K to use for the chat.- Specified by:
getTopKin interfaceChatOptions- Returns:
- the top K to use for the chat
-
getToolContext
Description copied from interface:ToolCallingChatOptionsGet the configured tool context.- Specified by:
getToolContextin interfaceToolCallingChatOptions- Returns:
- the tool context map.
-
setToolContext
Description copied from interface:ToolCallingChatOptionsSet the tool context values as map.- Specified by:
setToolContextin interfaceToolCallingChatOptions- Parameters:
toolContext- as map
-
copy
Description copied from interface:ChatOptionsReturns a copy of thisChatOptions.- Specified by:
copyin interfaceChatOptions- Returns:
- a copy of this
ChatOptions
-
mutate
Description copied from interface:ChatOptionsReturns a newChatOptions.Builderinitialized with the values of thisChatOptions. Concrete ChatOptions classes must override this to return the most concrete builder implementation.- Specified by:
mutatein interfaceChatOptions
-
hashCode
public int hashCode() -
equals
-
fromOptions
-