Class ConversationParam.ConversationParamBuilder<C extends ConversationParam,B extends ConversationParam.ConversationParamBuilder<C,B>>

Enclosing class:
ConversationParam

public abstract static class ConversationParam.ConversationParamBuilder<C extends ConversationParam,B extends ConversationParam.ConversationParamBuilder<C,B>> extends GenerationParamBase.GenerationParamBaseBuilder<C,B>
  • Constructor Details

    • ConversationParamBuilder

      public ConversationParamBuilder()
  • Method Details

    • messages

      public B messages(List<Message> messages)
      Returns:
      this.
    • maxLength

      @Deprecated public B maxLength(Integer maxLength)
      Deprecated.
      Returns:
      this.
    • topP

      public B topP(Double topP)
      Returns:
      this.
    • topK

      public B topK(Integer topK)
      Returns:
      this.
    • enableSearch

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

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

      public B resultFormat(String resultFormat)
      The output format, text or message, default message.
      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) for [qwen-turbo,qwen-plus].
      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):
       I
       I like
       I like apple
       true:
       I
       like
       apple
       
      Returns:
      this.
    • maxTokens

      public B maxTokens(Integer maxTokens)
      Returns:
      this.
    • repetitionPenalty

      public B repetitionPenalty(Float repetitionPenalty)
      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()
    • self

      protected abstract B self()
      Specified by:
      self in class GenerationParamBase.GenerationParamBaseBuilder<C extends ConversationParam,B extends ConversationParam.ConversationParamBuilder<C,B>>
    • build

      public abstract C build()
      Specified by:
      build in class GenerationParamBase.GenerationParamBaseBuilder<C extends ConversationParam,B extends ConversationParam.ConversationParamBuilder<C,B>>
    • toString

      public String toString()
      Overrides:
      toString in class GenerationParamBase.GenerationParamBaseBuilder<C extends ConversationParam,B extends ConversationParam.ConversationParamBuilder<C,B>>