Class ChatCompletionParam.ChatCompletionParamBuilder<C extends ChatCompletionParam,B extends 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 Details

    • ChatCompletionParamBuilder

      public ChatCompletionParamBuilder()
  • Method Details

    • messages

      public B messages(@NonNull List<Message> messages)
      Returns:
      this.
    • model

      public B model(@NonNull String model)
      Returns:
      this.
    • frequencyPenalty

      public B frequencyPenalty(Float 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

      public B logitBias(Map<Integer,Integer> logitBias)
      Returns:
      this.
    • logprobs

      public B logprobs(Boolean logprobs)
      Returns:
      this.
    • topLogprobs

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

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

      public B n(Integer n)
      Returns:
      this.
    • presencePenalty

      public B presencePenalty(Float presencePenalty)
      Returns:
      this.
    • responseFormat

      public B responseFormat(String responseFormat)
      Returns:
      this.
    • seed

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

      public B serviceTier(String serviceTier)
      Returns:
      this.
    • stop

      public B stop(String stop)
    • stop

      public B stop(Collection<? extends String> stop)
    • clearStop

      public B clearStop()
    • stream

      public B stream(Boolean stream)
      Returns:
      this.
    • streamOptions

      public B streamOptions(ChatCompletionStreamOptions streamOptions)
      Returns:
      this.
    • temperature

      public B temperature(Float temperature)
      Returns:
      this.
    • topP

      public B topP(Integer topP)
      Returns:
      this.
    • tools

      public B tools(List<ToolBase> tools)
      Returns:
      this.
    • toolChoice

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

      public B parallelToolCalls(Boolean parallelToolCalls)
      Returns:
      this.
    • preserveThinking

      public B preserveThinking(Boolean preserveThinking)
      Whether to preserve thinking/reasoning content in the response. When enabled, the model will include reasoning process in the output.
      Returns:
      this.
    • reasoningEffort

      public B reasoningEffort(String reasoningEffort)
      Controls the reasoning effort level for models that support it. Possible values: "low", "medium", "high"
      Returns:
      this.
    • maxCompletionTokens

      public B maxCompletionTokens(Integer 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

      public B toolStream(Boolean 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

      public B vlHighResolutionImages(Boolean vlHighResolutionImages)
      Enable high resolution image processing for vision-language models. Improves image understanding quality at the cost of more tokens.
      Returns:
      this.
    • vlEnableImageHwOutput

      public B vlEnableImageHwOutput(Boolean vlEnableImageHwOutput)
      Enable hardware-accelerated image output for vision-language models.
      Returns:
      this.
    • user

      public B user(String user)
      Returns:
      this.
    • self

      protected abstract B self()
      Specified by:
      self in class FlattenHalfDuplexParamBase.FlattenHalfDuplexParamBaseBuilder<C extends ChatCompletionParam,B extends ChatCompletionParam.ChatCompletionParamBuilder<C,B>>
    • build

      public abstract C build()
      Specified by:
      build in class FlattenHalfDuplexParamBase.FlattenHalfDuplexParamBaseBuilder<C extends ChatCompletionParam,B extends ChatCompletionParam.ChatCompletionParamBuilder<C,B>>
    • toString

      public String toString()
      Overrides:
      toString in class FlattenHalfDuplexParamBase.FlattenHalfDuplexParamBaseBuilder<C extends ChatCompletionParam,B extends ChatCompletionParam.ChatCompletionParamBuilder<C,B>>