Class ChatCompletionParam.ChatCompletionParamBuilder<C extends ChatCompletionParam,B extends ChatCompletionParam.ChatCompletionParamBuilder<C,B>>
java.lang.Object
com.alibaba.dashscope.legacy_2x.base.HalfDuplexParamBase.HalfDuplexParamBaseBuilder<C,B>
com.alibaba.dashscope.legacy_2x.base.FlattenHalfDuplexParamBase.FlattenHalfDuplexParamBaseBuilder<C,B>
com.alibaba.dashscope.legacy_2x.aigc.completion.ChatCompletionParam.ChatCompletionParamBuilder<C,B>
- Enclosing class:
- ChatCompletionParam
public abstract static class ChatCompletionParam.ChatCompletionParamBuilder<C extends ChatCompletionParam,B extends ChatCompletionParam.ChatCompletionParamBuilder<C,B>>
extends FlattenHalfDuplexParamBase.FlattenHalfDuplexParamBaseBuilder<C,B>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Cbuild()frequencyPenalty(Float frequencyPenalty) Number between -2.0 and 2.0.maxCompletionTokens(Integer maxCompletionTokens) The maximum number of tokens to generate for completion.parallelToolCalls(Boolean parallelToolCalls) presencePenalty(Float presencePenalty) preserveThinking(Boolean preserveThinking) Whether to preserve thinking/reasoning content in the response.reasoningEffort(String reasoningEffort) Controls the reasoning effort level for models that support it.responseFormat(String responseFormat) protected abstract Bself()serviceTier(String serviceTier) stop(Collection<? extends String> stop) streamOptions(ChatCompletionStreamOptions streamOptions) temperature(Float temperature) toolChoice(Object toolChoice) toolStream(Boolean toolStream) Whether to stream tool calls as they are generated.topLogprobs(Integer topLogprobs) toString()vlEnableImageHwOutput(Boolean vlEnableImageHwOutput) Enable hardware-accelerated image output for vision-language models.vlHighResolutionImages(Boolean vlHighResolutionImages) Enable high resolution image processing for vision-language models.Methods inherited from class com.alibaba.dashscope.legacy_2x.base.HalfDuplexParamBase.HalfDuplexParamBaseBuilder
apiKey, clearHeaders, clearParameters, enableEncrypt, header, headers, parameter, parameters, securityCheck, workspace
-
Constructor Details
-
ChatCompletionParamBuilder
public ChatCompletionParamBuilder()
-
-
Method Details
-
messages
- Returns:
this.
-
model
- Returns:
this.
-
frequencyPenalty
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.- Returns:
this.
-
logitBias
- Returns:
this.
-
logprobs
- Returns:
this.
-
topLogprobs
- Returns:
this.
-
maxTokens
- Returns:
this.
-
n
- Returns:
this.
-
presencePenalty
- Returns:
this.
-
responseFormat
- Returns:
this.
-
seed
- Returns:
this.
-
serviceTier
- Returns:
this.
-
stop
-
stop
-
clearStop
-
stream
- Returns:
this.
-
streamOptions
- Returns:
this.
-
temperature
- Returns:
this.
-
topP
- Returns:
this.
-
tools
- Returns:
this.
-
toolChoice
- Returns:
this.
-
parallelToolCalls
- Returns:
this.
-
preserveThinking
Whether to preserve thinking/reasoning content in the response. When enabled, the model will include reasoning process in the output.- Returns:
this.
-
reasoningEffort
Controls the reasoning effort level for models that support it. Possible values: "low", "medium", "high"- Returns:
this.
-
maxCompletionTokens
The maximum number of tokens to generate for completion. This is an alternative to max_tokens following OpenAI's newer API convention.- Returns:
this.
-
toolStream
Whether to stream tool calls as they are generated. When true, tool calls will be sent incrementally rather than all at once.- Returns:
this.
-
vlHighResolutionImages
Enable high resolution image processing for vision-language models. Improves image understanding quality at the cost of more tokens.- Returns:
this.
-
vlEnableImageHwOutput
Enable hardware-accelerated image output for vision-language models.- Returns:
this.
-
user
- Returns:
this.
-
self
- Specified by:
selfin classFlattenHalfDuplexParamBase.FlattenHalfDuplexParamBaseBuilder<C extends ChatCompletionParam,B extends ChatCompletionParam.ChatCompletionParamBuilder<C, B>>
-
build
- Specified by:
buildin classFlattenHalfDuplexParamBase.FlattenHalfDuplexParamBaseBuilder<C extends ChatCompletionParam,B extends ChatCompletionParam.ChatCompletionParamBuilder<C, B>>
-
toString
- Overrides:
toStringin classFlattenHalfDuplexParamBase.FlattenHalfDuplexParamBaseBuilder<C extends ChatCompletionParam,B extends ChatCompletionParam.ChatCompletionParamBuilder<C, B>>
-