Class GenerationParam.GenerationParamBuilder<C extends GenerationParam,B extends GenerationParam.GenerationParamBuilder<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.generation.GenerationParamBase.GenerationParamBaseBuilder<C,B>
com.alibaba.dashscope.legacy_2x.aigc.generation.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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Cbuild()enableSearch(Boolean enableSearch) enableThinking(Boolean enableThinking) Whether to enable reasoning.incrementalOutput(Boolean incrementalOutput) Used to control the streaming output mode.Whether to return log probabilities for each output token.Deprecated.Maximum tokens to generate.Number of responses to generate.parallelToolCalls(Boolean parallelToolCalls) enable parallel tool callsrepetitionPenalty(Float repetitionPenalty) repetition penaltyresponseFormat(ResponseFormat responseFormat) Format of the response content.resultFormat(String resultFormat) The output format, text or message, default message.searchOptions(SearchOptions searchOptions) Web search strategy.protected abstract Bself()stopString(String stopString) stopStrings(Collection<? extends String> stopStrings) stopTokens(Collection<? extends List<Integer>> stopTokens) temperature(Float temperature) Used to control the degree of randomness and diversity.thinkingBudget(Integer thinkingBudget) Maximum number of tokens generated during reasoning.toolChoice(Object toolChoice) Specify tool choiceSpecify which tools the model can use.topLogprobs(Integer topLogprobs) Number of most likely tokens to return at each token position.toString()translationOptions(TranslationOptions translationOptions) Translation options.Methods inherited from class com.alibaba.dashscope.legacy_2x.aigc.generation.GenerationParamBase.GenerationParamBaseBuilder
history, promptMethods inherited from class com.alibaba.dashscope.legacy_2x.base.HalfDuplexServiceParam.HalfDuplexServiceParamBuilder
model, resourcesMethods inherited from class com.alibaba.dashscope.legacy_2x.base.HalfDuplexParamBase.HalfDuplexParamBaseBuilder
apiKey, clearHeaders, clearParameters, enableEncrypt, header, headers, parameter, parameters, securityCheck, workspace
-
Constructor Details
-
GenerationParamBuilder
public GenerationParamBuilder()
-
-
Method Details
-
messages
- Returns:
this.
-
maxLength
Deprecated.- Returns:
this.
-
topP
- Returns:
this.
-
topK
- Returns:
this.
-
enableSearch
- Returns:
this.
-
seed
- Returns:
this.
-
resultFormat
The output format, text or message, default message.- Returns:
this.
-
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
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
Maximum tokens to generate.- Returns:
this.
-
repetitionPenalty
repetition penalty- Returns:
this.
-
stopString
-
stopStrings
-
clearStopStrings
-
stopToken
-
stopTokens
-
clearStopTokens
-
tools
Specify which tools the model can use.- Returns:
this.
-
toolChoice
Specify tool choice- Returns:
this.
-
parallelToolCalls
enable parallel tool calls- Returns:
this.
-
searchOptions
Web search strategy. Takes effect only when enable_search is true.- Returns:
this.
-
responseFormat
Format of the response content.- Returns:
this.
-
enableThinking
Whether to enable reasoning.- Returns:
this.
-
thinkingBudget
Maximum number of tokens generated during reasoning.- Returns:
this.
-
logprobs
Whether to return log probabilities for each output token.- Returns:
this.
-
topLogprobs
Number of most likely tokens to return at each token position.- Returns:
this.
-
n
Number of responses to generate.- Returns:
this.
-
translationOptions
Translation options.- Returns:
this.
-
self
- Specified by:
selfin classGenerationParamBase.GenerationParamBaseBuilder<C extends GenerationParam,B extends GenerationParam.GenerationParamBuilder<C, B>>
-
build
- Specified by:
buildin classGenerationParamBase.GenerationParamBaseBuilder<C extends GenerationParam,B extends GenerationParam.GenerationParamBuilder<C, B>>
-
toString
- Overrides:
toStringin classGenerationParamBase.GenerationParamBaseBuilder<C extends GenerationParam,B extends GenerationParam.GenerationParamBuilder<C, B>>
-