Class MultiModalConversationParam.MultiModalConversationParamBuilder<C extends MultiModalConversationParam,B extends MultiModalConversationParam.MultiModalConversationParamBuilder<C,B>>

java.lang.Object
com.alibaba.dashscope.legacy_2x.base.HalfDuplexParamBase.HalfDuplexParamBaseBuilder<C,B>
com.alibaba.dashscope.legacy_2x.base.HalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C,B>
com.alibaba.dashscope.legacy_2x.aigc.multimodalconversation.MultiModalConversationParam.MultiModalConversationParamBuilder<C,B>
Enclosing class:
MultiModalConversationParam

public abstract static class MultiModalConversationParam.MultiModalConversationParamBuilder<C extends MultiModalConversationParam,B extends MultiModalConversationParam.MultiModalConversationParamBuilder<C,B>> extends HalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C,B>
  • Constructor Details

    • MultiModalConversationParamBuilder

      public MultiModalConversationParamBuilder()
  • Method Details

    • message

      public B message(Object message)
    • messages

      public B messages(Collection<? extends Object> messages)
    • clearMessages

      public B clearMessages()
    • maxLength

      @Deprecated public B maxLength(Integer maxLength)
      Deprecated.
      The maximum length of tokens to generate. The token count of your prompt plus max_length cannot exceed the model's context length. Most models have a context length of 2000 tokens
      Returns:
      this.
    • topP

      public B topP(Double topP)
      A sampling strategy, 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
      Returns:
      this.
    • topK

      public B topK(Integer topK)
      A sampling strategy, the k largest elements of the given mass are considered
      Returns:
      this.
    • repetitionPenalty

      public B repetitionPenalty(Float repetitionPenalty)
      Used to control the repetitiveness of the model when generating text. Increasing the repetition_penalty can reduce the repetitiveness of the model's output. A value of 1.0 indicates no penalty. Default value: 1.0
      Returns:
      this.
    • presencePenalty

      public B presencePenalty(Float presencePenalty)
      A parameter that controls the repetitiveness of words. It reduces the probability of the same word appearing repeatedly by penalizing words that have already been generated, thus increasing the diversity of the generated text. A value of 0 indicates no penalty. Default value: 0.0
      Returns:
      this.
    • enableSearch

      public B enableSearch(Boolean enableSearch)
      Returns:
      this.
    • searchOptions

      public B searchOptions(SearchOptions searchOptions)
      Web search strategy. Takes effect only when enable_search is true.
      Returns:
      this.
    • seed

      public B seed(Integer seed)
      Returns:
      this.
    • temperature

      public B temperature(Float temperature)
      Used to control the degree of randomness and diversity. Specifically, the temperature value controls the degree to which the probability distribution of each candidate word is smoothed when generating text. A higher temperature value will reduce the peak value of the probability distribution, allowing more low-probability words to be selected, and the generated results will be more diverse; while a lower temperature value will enhance the peak value of the probability distribution, making it easier for high-probability words to be selected, the generated results are more deterministic, range(0, 2). Default value: 1.0
      Returns:
      this.
    • maxTokens

      public B maxTokens(Integer maxTokens)
      The maximum length of tokens to generate. The token count of your prompt plus max_length cannot exceed the model's context length.
      Returns:
      this.
    • incrementalOutput

      public B incrementalOutput(Boolean incrementalOutput)
      Used to control the streaming output mode. If true, the subsequent output will include the previously input content by default. Otherwise, the subsequent output will not include the previously output content. Default: false eg(false): /** Used to control the streaming output mode. If true, each chunk contains only incremental content without accumulation. If false, SDK accumulates chunks locally and returns full content in each chunk. Must be explicitly set - no default value.
       incrementalOutput=true (incremental):
       Chunk1: reasoning="I'll analyze first", content=[]
       Chunk2: reasoning="It looks like a sheep", content=[{text="This image"}]
       Chunk3: reasoning="", content=[{text="and a car"}]
      
       incrementalOutput=false (full):
       Chunk1: reasoning="I'll analyze first", content=[]
       Chunk2: reasoning="I'll analyze first. It looks like a sheep", content=[{text="This image"}]
       Chunk3: reasoning="I'll analyze first. It looks like a sheep", content=[{text="This image and a car"}]
       
      Returns:
      this.
    • modalities

      public B modalities(List<String> modalities)
      Output format of the model including "text" and "audio". Default value: ["text"]
      Returns:
      this.
    • audio

      public B audio(AudioParameters audio)
      audio output parameters
      Returns:
      this.
    • ocrOptions

      public B ocrOptions(OcrOptions ocrOptions)
      ocr options
      Returns:
      this.
    • text

      public B text(String text)
      text input
      Returns:
      this.
    • voice

      public B voice(AudioParameters.Voice voice)
      voice of tts
      Returns:
      this.
    • tools

      public B tools(List<ToolBase> tools)
      Specify which tools the model can use.
      Returns:
      this.
    • toolChoice

      public B toolChoice(Object toolChoice)
      Specify tool choice
      Returns:
      this.
    • parallelToolCalls

      public B parallelToolCalls(Boolean parallelToolCalls)
      enable parallel tool calls
      Returns:
      this.
    • vlHighResolutionImages

      public B vlHighResolutionImages(Boolean vlHighResolutionImages)
      enable vl_high_resolution_images
      Returns:
      this.
    • vlEnableImageHwOutput

      public B vlEnableImageHwOutput(Boolean vlEnableImageHwOutput)
      enable vl_enable_image_hw_output
      Returns:
      this.
    • responseFormat

      public B responseFormat(ResponseFormat responseFormat)
      response format
      Returns:
      this.
    • negativePrompt

      public B negativePrompt(String negativePrompt)
      negative prompt
      Returns:
      this.
    • promptExtend

      public B promptExtend(Boolean promptExtend)
      prompt extend
      Returns:
      this.
    • watermark

      public B watermark(Boolean watermark)
      watermark
      Returns:
      this.
    • size

      public B size(String size)
      picture size
      Returns:
      this.
    • n

      public B n(Integer n)
      number of images
      Returns:
      this.
    • languageType

      public B languageType(String languageType)
      language type for tts
      Returns:
      this.
    • enableThinking

      public B enableThinking(Boolean enableThinking)
      enable thinking
      Returns:
      this.
    • thinkingBudget

      public B thinkingBudget(Integer thinkingBudget)
      thinking budget
      Returns:
      this.
    • stopString

      public B stopString(String stopString)
    • stopStrings

      public B stopStrings(Collection<? extends String> stopStrings)
    • clearStopStrings

      public B clearStopStrings()
    • stopToken

      public B stopToken(List<Integer> stopToken)
    • stopTokens

      public B stopTokens(Collection<? extends List<Integer>> stopTokens)
    • clearStopTokens

      public B clearStopTokens()
    • logprobs

      public B logprobs(Boolean logprobs)
      whether to return log probabilities of output tokens, supported for qwen-vl-ocr-2025-04-13 and later
      Returns:
      this.
    • topLogprobs

      public B topLogprobs(Integer topLogprobs)
      number of top candidate tokens to return log probabilities for, range [0,5], only effective when logprobs is true
      Returns:
      this.
    • self

      protected abstract B self()
      Specified by:
      self in class HalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C extends MultiModalConversationParam,B extends MultiModalConversationParam.MultiModalConversationParamBuilder<C,B>>
    • build

      public abstract C build()
      Specified by:
      build in class HalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C extends MultiModalConversationParam,B extends MultiModalConversationParam.MultiModalConversationParamBuilder<C,B>>
    • toString

      public String toString()
      Overrides:
      toString in class HalfDuplexServiceParam.HalfDuplexServiceParamBuilder<C extends MultiModalConversationParam,B extends MultiModalConversationParam.MultiModalConversationParamBuilder<C,B>>