Class DeepSeekApi.ChatCompletionRequest.Builder
java.lang.Object
org.springframework.ai.deepseek.api.DeepSeekApi.ChatCompletionRequest.Builder
- Enclosing class:
- DeepSeekApi.ChatCompletionRequest
Builder for creating
DeepSeekApi.ChatCompletionRequest instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theDeepSeekApi.ChatCompletionRequest.frequencyPenalty(@Nullable Double frequencyPenalty) Set the frequency penalty.Set whether to return log probabilities.Set the maximum number of tokens that can be generated.messages(List<DeepSeekApi.ChatCompletionMessage> messages) Set the messages comprising the conversation so far.Set the ID of the model to use.presencePenalty(@Nullable Double presencePenalty) Set the presence penalty.reasoningEffort(@Nullable DeepSeekApi.ChatCompletionRequest.ReasoningEffort reasoningEffort) Set the reasoning effort level.responseFormat(@Nullable ResponseFormat responseFormat) Set the response format.Set the stop sequences.Set whether to stream the response.temperature(@Nullable Double temperature) Set the sampling temperature.thinking(@Nullable DeepSeekApi.ChatCompletionRequest.Thinking thinking) Set the thinking mode configuration.toolChoice(@Nullable Object toolChoice) Set the tool choice.tools(@Nullable List<DeepSeekApi.FunctionTool> tools) Set the tools the model may call.topLogprobs(@Nullable Integer topLogprobs) Set the number of most likely tokens to return log probabilities for.Set the top_p value.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
messages
public DeepSeekApi.ChatCompletionRequest.Builder messages(List<DeepSeekApi.ChatCompletionMessage> messages) Set the messages comprising the conversation so far.- Parameters:
messages- the messages.- Returns:
- this builder.
-
model
Set the ID of the model to use.- Parameters:
model- the model id.- Returns:
- this builder.
-
frequencyPenalty
public DeepSeekApi.ChatCompletionRequest.Builder frequencyPenalty(@Nullable Double frequencyPenalty) Set the frequency penalty.- Parameters:
frequencyPenalty- the frequency penalty.- Returns:
- this builder.
-
maxTokens
Set the maximum number of tokens that can be generated.- Parameters:
maxTokens- the max tokens.- Returns:
- this builder.
-
presencePenalty
Set the presence penalty.- Parameters:
presencePenalty- the presence penalty.- Returns:
- this builder.
-
responseFormat
public DeepSeekApi.ChatCompletionRequest.Builder responseFormat(@Nullable ResponseFormat responseFormat) Set the response format.- Parameters:
responseFormat- the response format.- Returns:
- this builder.
-
stop
Set the stop sequences.- Parameters:
stop- the stop sequences.- Returns:
- this builder.
-
stream
Set whether to stream the response.- Parameters:
stream- whether to stream.- Returns:
- this builder.
-
temperature
Set the sampling temperature.- Parameters:
temperature- the temperature.- Returns:
- this builder.
-
topP
Set the top_p value.- Parameters:
topP- the top_p value.- Returns:
- this builder.
-
logprobs
Set whether to return log probabilities.- Parameters:
logprobs- whether to return log probabilities.- Returns:
- this builder.
-
topLogprobs
Set the number of most likely tokens to return log probabilities for.- Parameters:
topLogprobs- the top logprobs.- Returns:
- this builder.
-
tools
public DeepSeekApi.ChatCompletionRequest.Builder tools(@Nullable List<DeepSeekApi.FunctionTool> tools) Set the tools the model may call.- Parameters:
tools- the tools.- Returns:
- this builder.
-
toolChoice
Set the tool choice.- Parameters:
toolChoice- the tool choice.- Returns:
- this builder.
-
reasoningEffort
public DeepSeekApi.ChatCompletionRequest.Builder reasoningEffort(@Nullable DeepSeekApi.ChatCompletionRequest.ReasoningEffort reasoningEffort) Set the reasoning effort level.- Parameters:
reasoningEffort- the reasoning effort.- Returns:
- this builder.
-
thinking
public DeepSeekApi.ChatCompletionRequest.Builder thinking(@Nullable DeepSeekApi.ChatCompletionRequest.Thinking thinking) Set the thinking mode configuration.- Parameters:
thinking- the thinking configuration.- Returns:
- this builder.
-
build
Build theDeepSeekApi.ChatCompletionRequest.- Returns:
- a new
DeepSeekApi.ChatCompletionRequest.
-