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 the DashScopeApiSpec.ChatCompletionRequestParameter.ToolChoiceBuilder to 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.
  • Constructor Details

  • Method Details

    • extraBody

      public Map<String,Object> 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • resultFormat

      public String resultFormat()
      Returns the value of the resultFormat record component.
      Returns:
      the value of the resultFormat record component
    • seed

      public Integer seed()
      Returns the value of the seed record component.
      Returns:
      the value of the seed record component
    • topP

      public Double topP()
      Returns the value of the topP record component.
      Returns:
      the value of the topP record component
    • topK

      public Integer topK()
      Returns the value of the topK record component.
      Returns:
      the value of the topK record component
    • repetitionPenalty

      public Double repetitionPenalty()
      Returns the value of the repetitionPenalty record component.
      Returns:
      the value of the repetitionPenalty record component
    • presencePenalty

      public Double presencePenalty()
      Returns the value of the presencePenalty record component.
      Returns:
      the value of the presencePenalty record component
    • temperature

      public Double temperature()
      Returns the value of the temperature record component.
      Returns:
      the value of the temperature record component
    • stop

      public List<Object> stop()
      Returns the value of the stop record component.
      Returns:
      the value of the stop record component
    • enableSearch

      public Boolean enableSearch()
      Returns the value of the enableSearch record component.
      Returns:
      the value of the enableSearch record component
    • searchOptions

      public DashScopeApiSpec.SearchOptions searchOptions()
      Returns the value of the searchOptions record component.
      Returns:
      the value of the searchOptions record component
    • responseFormat

      public DashScopeResponseFormat responseFormat()
      Returns the value of the responseFormat record component.
      Returns:
      the value of the responseFormat record component
    • incrementalOutput

      public Boolean incrementalOutput()
      Returns the value of the incrementalOutput record component.
      Returns:
      the value of the incrementalOutput record component
    • tools

      Returns the value of the tools record component.
      Returns:
      the value of the tools record component
    • toolChoice

      public Object toolChoice()
      Returns the value of the toolChoice record component.
      Returns:
      the value of the toolChoice record component
    • parallelToolCalls

      public Boolean parallelToolCalls()
      Returns the value of the parallelToolCalls record component.
      Returns:
      the value of the parallelToolCalls record component
    • enableThinking

      public Boolean enableThinking()
      Returns the value of the enableThinking record component.
      Returns:
      the value of the enableThinking record component
    • thinkingBudget

      public Integer thinkingBudget()
      Returns the value of the thinkingBudget record component.
      Returns:
      the value of the thinkingBudget record component
    • vlHighResolutionImages

      public Boolean vlHighResolutionImages()
      Returns the value of the vlHighResolutionImages record component.
      Returns:
      the value of the vlHighResolutionImages record component
    • vlEnableImageHwOutput

      public Boolean vlEnableImageHwOutput()
      Returns the value of the vlEnableImageHwOutput record component.
      Returns:
      the value of the vlEnableImageHwOutput record component
    • ocrOptions

      public DashScopeApiSpec.OCROption ocrOptions()
      Returns the value of the ocrOptions record component.
      Returns:
      the value of the ocrOptions record component
    • logprobs

      public Boolean logprobs()
      Returns the value of the logprobs record component.
      Returns:
      the value of the logprobs record component
    • topLogprobs

      public Integer topLogprobs()
      Returns the value of the topLogprobs record component.
      Returns:
      the value of the topLogprobs record component
    • translationOptions

      public DashScopeApiSpec.TranslationOptions translationOptions()
      Returns the value of the translationOptions record component.
      Returns:
      the value of the translationOptions record component
    • stream

      public Boolean stream()
      Returns the value of the stream record component.
      Returns:
      the value of the stream record component
    • streamOptions

      public Object streamOptions()
      Returns the value of the streamOptions record component.
      Returns:
      the value of the streamOptions record component
    • modalities

      public List<String> modalities()
      Returns the value of the modalities record component.
      Returns:
      the value of the modalities record component
    • audio

      public Object audio()
      Returns the value of the audio record component.
      Returns:
      the value of the audio record component
    • maxTokens

      public Integer maxTokens()
      Returns the value of the maxTokens record component.
      Returns:
      the value of the maxTokens record component
    • maxInputTokens

      public Integer maxInputTokens()
      Returns the value of the maxInputTokens record component.
      Returns:
      the value of the maxInputTokens record component
    • asrOptions

      public Object asrOptions()
      Returns the value of the asrOptions record component.
      Returns:
      the value of the asrOptions record component
    • outputFormat

      public String outputFormat()
      Returns the value of the outputFormat record component.
      Returns:
      the value of the outputFormat record component