OpenAIChatParams

class OpenAIChatParams(temperature: Double? = null, maxTokens: Int? = null, numberOfChoices: Int? = null, speculation: String? = null, schema: LLMParams.Schema? = null, toolChoice: LLMParams.ToolChoice? = null, user: String? = null, includeThoughts: Boolean? = null, thinkingBudget: Int? = null, additionalProperties: Map<String, JsonElement>? = null, val frequencyPenalty: Double? = null, val presencePenalty: Double? = null, val parallelToolCalls: Boolean? = null, val promptCacheKey: String? = null, val safetyIdentifier: String? = null, val serviceTier: ServiceTier? = null, val store: Boolean? = null, val audio: OpenAIAudioConfig? = null, val logprobs: Boolean? = null, val reasoningEffort: ReasoningEffort? = null, val stop: List<String>? = null, val topLogprobs: Int? = null, val topP: Double? = null, val webSearchOptions: OpenAIWebSearchOptions? = null) : LLMParams, OpenAIParams(source)

OpenAI chat/completions parameters layered on top of LLMParams.

These options mirror the fields commonly used with OpenAI’s Chat Completions / Responses APIs and add OpenAI-specific controls (audio, logprobs, reasoning effort, response formatting, service tiers, etc.). All parameters are optional; when unset, provider/model defaults apply.

Constructors

Link copied to clipboard
constructor(temperature: Double? = null, maxTokens: Int? = null, numberOfChoices: Int? = null, speculation: String? = null, schema: LLMParams.Schema? = null, toolChoice: LLMParams.ToolChoice? = null, user: String? = null, includeThoughts: Boolean? = null, thinkingBudget: Int? = null, additionalProperties: Map<String, JsonElement>? = null, frequencyPenalty: Double? = null, presencePenalty: Double? = null, parallelToolCalls: Boolean? = null, promptCacheKey: String? = null, safetyIdentifier: String? = null, serviceTier: ServiceTier? = null, store: Boolean? = null, audio: OpenAIAudioConfig? = null, logprobs: Boolean? = null, reasoningEffort: ReasoningEffort? = null, stop: List<String>? = null, topLogprobs: Int? = null, topP: Double? = null, webSearchOptions: OpenAIWebSearchOptions? = null)

Properties

Link copied to clipboard

Audio output configuration when using audio-capable models.

Link copied to clipboard

Number in -2.0, 2.0—penalizes frequent tokens to reduce repetition.

Link copied to clipboard
Link copied to clipboard
val logprobs: Boolean? = null

Whether to include log-probabilities for output tokens.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Allow multiple tool calls in parallel.

Link copied to clipboard
val presencePenalty: Double? = null

Number in -2.0, 2.0—encourages an introduction of new tokens/topics.

Link copied to clipboard
val promptCacheKey: String? = null

Stable cache key for prompt caching (non-blank when provided).

Link copied to clipboard

Constrains reasoning effort (e.g., MINIMAL/LOW/MEDIUM/HIGH).

Link copied to clipboard

Stable app-scoped user ID for policy enforcement (non-blank when provided).

Link copied to clipboard
Link copied to clipboard

Processing tier selection for cost/latency trade-offs.

Link copied to clipboard
Link copied to clipboard
val stop: List<String>? = null

Stop sequences (0–4 items); generation halts before any of these.

Link copied to clipboard
val store: Boolean? = null

Whether the provider may store outputs for improvement/evals.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val topLogprobs: Int? = null

Number of top alternatives per position (0–20). Requires logprobs = true.

Link copied to clipboard
val topP: Double? = null

Nucleus sampling in (0.0, 1.0]; use instead of temperature.

Link copied to clipboard
val user: String?
Link copied to clipboard

Configure web search tool usage (if supported).

Functions

Link copied to clipboard
operator fun component1(): Double?
Link copied to clipboard
operator fun component10(): Map<String, JsonElement>?
Link copied to clipboard
operator fun component2(): Int?
Link copied to clipboard
operator fun component3(): Int?
Link copied to clipboard
operator fun component4(): String?
Link copied to clipboard
operator fun component5(): LLMParams.Schema?
Link copied to clipboard
Link copied to clipboard
operator fun component7(): String?
Link copied to clipboard
operator fun component8(): Boolean?
Link copied to clipboard
operator fun component9(): Int?
Link copied to clipboard
fun copy(temperature: Double? = this.temperature, maxTokens: Int? = this.maxTokens, numberOfChoices: Int? = this.numberOfChoices, speculation: String? = this.speculation, schema: LLMParams.Schema? = this.schema, toolChoice: LLMParams.ToolChoice? = this.toolChoice, user: String? = this.user, includeThoughts: Boolean? = this.includeThoughts, thinkingBudget: Int? = this.thinkingBudget, additionalProperties: Map<String, JsonElement>? = this.additionalProperties, frequencyPenalty: Double? = this.frequencyPenalty, presencePenalty: Double? = this.presencePenalty, parallelToolCalls: Boolean? = this.parallelToolCalls, promptCacheKey: String? = this.promptCacheKey, safetyIdentifier: String? = this.safetyIdentifier, serviceTier: ServiceTier? = this.serviceTier, store: Boolean? = this.store, audio: OpenAIAudioConfig? = this.audio, logprobs: Boolean? = this.logprobs, reasoningEffort: ReasoningEffort? = this.reasoningEffort, stop: List<String>? = this.stop, topLogprobs: Int? = this.topLogprobs, topP: Double? = this.topP, webSearchOptions: OpenAIWebSearchOptions? = this.webSearchOptions): OpenAIChatParams

Creates a copy of this instance with the ability to modify any of its properties.

open fun copy(temperature: Double?, maxTokens: Int?, numberOfChoices: Int?, speculation: String?, schema: LLMParams.Schema?, toolChoice: LLMParams.ToolChoice?, user: String?, includeThoughts: Boolean?, thinkingBudget: Int?, additionalProperties: Map<String, JsonElement>?): LLMParams
Link copied to clipboard
fun default(default: LLMParams): LLMParams
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String