Class GenerationParam.GenerationParamBuilder<C extends GenerationParam,B extends GenerationParam.GenerationParamBuilder<C,B>>

Direct Known Subclasses:
QwenParam.QwenParamBuilder
Enclosing class:
GenerationParam

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

    • GenerationParamBuilder

      public GenerationParamBuilder()
  • 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).
      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
       when true:
       I
       like
       apple
       
      Returns:
      this.
    • maxTokens

      public B maxTokens(Integer maxTokens)
      Maximum tokens to generate.
      Returns:
      this.
    • repetitionPenalty

      public B repetitionPenalty(Float repetitionPenalty)
      repetition penalty
      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()
    • 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.
    • searchOptions

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

      public B responseFormat(ResponseFormat responseFormat)
      Format of the response content.
      Returns:
      this.
    • enableThinking

      public B enableThinking(Boolean enableThinking)
      Whether to enable reasoning.
      Returns:
      this.
    • thinkingBudget

      public B thinkingBudget(Integer thinkingBudget)
      Maximum number of tokens generated during reasoning.
      Returns:
      this.
    • logprobs

      public B logprobs(Boolean logprobs)
      Whether to return log probabilities for each output token.
      Returns:
      this.
    • topLogprobs

      public B topLogprobs(Integer topLogprobs)
      Number of most likely tokens to return at each token position.
      Returns:
      this.
    • n

      public B n(Integer n)
      Number of responses to generate.
      Returns:
      this.
    • translationOptions

      public B translationOptions(TranslationOptions translationOptions)
      Translation options.
      Returns:
      this.
    • self

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

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

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