Record Class DashScopeApiSpec.ChatCompletionRequestParameter
java.lang.Object
java.lang.Record
com.alibaba.cloud.ai.dashscope.spec.DashScopeApiSpec.ChatCompletionRequestParameter
- Record Components:
maxTokens- The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.stop- Up to 4 sequences where the API will stop generating further tokens.temperature- What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.topP- An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.tools- A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.toolChoice- Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. Specifying a particular function via {"type: "function", "function": {"name": "my_function"}} forces the model to call that function. none is the default when no functions are present. auto is the default if functions are present. Use theDashScopeApiSpec.ChatCompletionRequestParameter.ToolChoiceBuilderto create the tool choice value.stream- Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message.vlHighResolutionImages- Whether to generate high-resolution images for visualization.enableThinking- Whether to enable the model to think before generating responses. This is useful for complex tasks where the model needs to reason through the problem before providing an answer.thinkingBudget- The maximum length of the thinking process takes effect when enable_thinking is true, and is suitable for Qwen3 full system model.vlEnableImageHwOutput- Whether to return the size after image scaling. The model will scale the input image. When configured as True, it will return the height and width of the image after being scaled. When the streaming output is turned on, this information will be returned in the last data block (chunk)logprobs- Whether to return the logarithmic probability of the output token.topLogprobs- Specifies the number of candidate tokens that return the maximum probability of the model when generated at each step. Value range: [0,5] Effective only if logprobs is true.
- Enclosing class:
- DashScopeApiSpec
public static record DashScopeApiSpec.ChatCompletionRequestParameter(String resultFormat, Integer seed, Double topP, Integer topK, Double repetitionPenalty, Double presencePenalty, Double temperature, List<Object> stop, Boolean enableSearch, DashScopeApiSpec.SearchOptions searchOptions, DashScopeResponseFormat responseFormat, Boolean incrementalOutput, List<DashScopeApiSpec.FunctionTool> tools, Object toolChoice, Boolean parallelToolCalls, Boolean enableThinking, Integer thinkingBudget, Boolean vlHighResolutionImages, Boolean vlEnableImageHwOutput, DashScopeApiSpec.OCROption ocrOptions, Boolean logprobs, Integer topLogprobs, DashScopeApiSpec.TranslationOptions translationOptions, Boolean stream, Object streamOptions, List<String> modalities, Object audio, Integer maxTokens, Integer maxInputTokens, Object asrOptions, String outputFormat, Map<String,Object> extraBody)
extends Record
Creates a model response for the given chat conversation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelper factory that creates a tool_choice of type 'none', 'auto' or selected function by name. -
Constructor Summary
ConstructorsConstructorDescriptionshortcut constructor for chat request parameterChatCompletionRequestParameter(String resultFormat, Integer seed, Double topP, Integer topK, Double repetitionPenalty, Double presencePenalty, Double temperature, List<Object> stop, Boolean enableSearch, DashScopeApiSpec.SearchOptions searchOptions, DashScopeResponseFormat responseFormat, Boolean incrementalOutput, List<DashScopeApiSpec.FunctionTool> tools, Object toolChoice, Boolean parallelToolCalls, Boolean enableThinking, Integer thinkingBudget, Boolean vlHighResolutionImages, Boolean vlEnableImageHwOutput, DashScopeApiSpec.OCROption ocrOptions, Boolean logprobs, Integer topLogprobs, DashScopeApiSpec.TranslationOptions translationOptions, Boolean stream, Object streamOptions, List<String> modalities, Object audio, Integer maxTokens, Integer maxInputTokens, Object asrOptions, String outputFormat, Map<String, Object> extraBody) Compact constructor that ensures extraBody is initialized as a mutable HashMap when null, enabling @JsonAnySetter to populate it during deserialization. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theasrOptionsrecord component.audio()Returns the value of theaudiorecord component.Returns the value of theenableSearchrecord component.Returns the value of theenableThinkingrecord component.final booleanIndicates whether some other object is "equal to" this one.Overrides the default accessor to add @JsonAnyGetter annotation.final inthashCode()Returns a hash code value for this object.Returns the value of theincrementalOutputrecord component.logprobs()Returns the value of thelogprobsrecord component.Returns the value of themaxInputTokensrecord component.Returns the value of themaxTokensrecord component.Returns the value of themodalitiesrecord component.Returns the value of theocrOptionsrecord component.Returns the value of theoutputFormatrecord component.Returns the value of theparallelToolCallsrecord component.Returns the value of thepresencePenaltyrecord component.Returns the value of therepetitionPenaltyrecord component.Returns the value of theresponseFormatrecord component.Returns the value of theresultFormatrecord component.Returns the value of thesearchOptionsrecord component.seed()Returns the value of theseedrecord component.stop()Returns the value of thestoprecord component.stream()Returns the value of thestreamrecord component.Returns the value of thestreamOptionsrecord component.Returns the value of thetemperaturerecord component.Returns the value of thethinkingBudgetrecord component.Returns the value of thetoolChoicerecord component.tools()Returns the value of thetoolsrecord component.topK()Returns the value of thetopKrecord component.Returns the value of thetopLogprobsrecord component.topP()Returns the value of thetopPrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationOptionsrecord component.Returns the value of thevlEnableImageHwOutputrecord component.Returns the value of thevlHighResolutionImagesrecord component.
-
Constructor Details
-
ChatCompletionRequestParameter
public ChatCompletionRequestParameter(String resultFormat, Integer seed, Double topP, Integer topK, Double repetitionPenalty, Double presencePenalty, Double temperature, List<Object> stop, Boolean enableSearch, DashScopeApiSpec.SearchOptions searchOptions, DashScopeResponseFormat responseFormat, Boolean incrementalOutput, List<DashScopeApiSpec.FunctionTool> tools, Object toolChoice, Boolean parallelToolCalls, Boolean enableThinking, Integer thinkingBudget, Boolean vlHighResolutionImages, Boolean vlEnableImageHwOutput, DashScopeApiSpec.OCROption ocrOptions, Boolean logprobs, Integer topLogprobs, DashScopeApiSpec.TranslationOptions translationOptions, Boolean stream, Object streamOptions, List<String> modalities, Object audio, Integer maxTokens, Integer maxInputTokens, Object asrOptions, String outputFormat, Map<String, Object> extraBody) Compact constructor that ensures extraBody is initialized as a mutable HashMap when null, enabling @JsonAnySetter to populate it during deserialization. -
ChatCompletionRequestParameter
public ChatCompletionRequestParameter()shortcut constructor for chat request parameter
-
-
Method Details
-
extraBody
Overrides the default accessor to add @JsonAnyGetter annotation. This causes Jackson to flatten the extraBody map contents to the top level of the JSON.- Returns:
- The extraBody map, or null if not set.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
resultFormat
Returns the value of theresultFormatrecord component.- Returns:
- the value of the
resultFormatrecord component
-
seed
Returns the value of theseedrecord component.- Returns:
- the value of the
seedrecord component
-
topP
Returns the value of thetopPrecord component.- Returns:
- the value of the
topPrecord component
-
topK
Returns the value of thetopKrecord component.- Returns:
- the value of the
topKrecord component
-
repetitionPenalty
Returns the value of therepetitionPenaltyrecord component.- Returns:
- the value of the
repetitionPenaltyrecord component
-
presencePenalty
Returns the value of thepresencePenaltyrecord component.- Returns:
- the value of the
presencePenaltyrecord component
-
temperature
Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-
stop
Returns the value of thestoprecord component.- Returns:
- the value of the
stoprecord component
-
enableSearch
Returns the value of theenableSearchrecord component.- Returns:
- the value of the
enableSearchrecord component
-
searchOptions
Returns the value of thesearchOptionsrecord component.- Returns:
- the value of the
searchOptionsrecord component
-
responseFormat
Returns the value of theresponseFormatrecord component.- Returns:
- the value of the
responseFormatrecord component
-
incrementalOutput
Returns the value of theincrementalOutputrecord component.- Returns:
- the value of the
incrementalOutputrecord component
-
tools
Returns the value of thetoolsrecord component.- Returns:
- the value of the
toolsrecord component
-
toolChoice
Returns the value of thetoolChoicerecord component.- Returns:
- the value of the
toolChoicerecord component
-
parallelToolCalls
Returns the value of theparallelToolCallsrecord component.- Returns:
- the value of the
parallelToolCallsrecord component
-
enableThinking
Returns the value of theenableThinkingrecord component.- Returns:
- the value of the
enableThinkingrecord component
-
thinkingBudget
Returns the value of thethinkingBudgetrecord component.- Returns:
- the value of the
thinkingBudgetrecord component
-
vlHighResolutionImages
Returns the value of thevlHighResolutionImagesrecord component.- Returns:
- the value of the
vlHighResolutionImagesrecord component
-
vlEnableImageHwOutput
Returns the value of thevlEnableImageHwOutputrecord component.- Returns:
- the value of the
vlEnableImageHwOutputrecord component
-
ocrOptions
Returns the value of theocrOptionsrecord component.- Returns:
- the value of the
ocrOptionsrecord component
-
logprobs
Returns the value of thelogprobsrecord component.- Returns:
- the value of the
logprobsrecord component
-
topLogprobs
Returns the value of thetopLogprobsrecord component.- Returns:
- the value of the
topLogprobsrecord component
-
translationOptions
Returns the value of thetranslationOptionsrecord component.- Returns:
- the value of the
translationOptionsrecord component
-
stream
Returns the value of thestreamrecord component.- Returns:
- the value of the
streamrecord component
-
streamOptions
Returns the value of thestreamOptionsrecord component.- Returns:
- the value of the
streamOptionsrecord component
-
modalities
Returns the value of themodalitiesrecord component.- Returns:
- the value of the
modalitiesrecord component
-
audio
Returns the value of theaudiorecord component.- Returns:
- the value of the
audiorecord component
-
maxTokens
Returns the value of themaxTokensrecord component.- Returns:
- the value of the
maxTokensrecord component
-
maxInputTokens
Returns the value of themaxInputTokensrecord component.- Returns:
- the value of the
maxInputTokensrecord component
-
asrOptions
Returns the value of theasrOptionsrecord component.- Returns:
- the value of the
asrOptionsrecord component
-
outputFormat
Returns the value of theoutputFormatrecord component.- Returns:
- the value of the
outputFormatrecord component
-