copy

fun copy(model: ChatModel = this.model, frequencyPenalty: Double? = this.frequencyPenalty, maxTokens: Int? = this.maxTokens, presencePenalty: Double? = this.presencePenalty, responseFormat: ResponseFormat? = this.responseFormat, stop: StopReason? = this.stop, stream: Boolean? = this.stream, streamOptions: StreamOptions? = this.streamOptions, temperature: Double? = this.temperature, topP: Double? = this.topP, tools: List<Tool>? = this.tools, toolChoice: ToolChoice? = this.toolChoice, logprobs: Boolean? = this.logprobs, topLogprobs: Int? = this.topLogprobs): ChatCompletionParams

Creates a copy of these parameters with optional changes to specific properties.

Example:

// Create a streaming version of existing parameters
val streamParams = regularParams.copy(stream = true)

Return

A new ChatCompletionParams instance with the specified changes

Parameters

model

New chat model to use, or existing value if not specified

frequencyPenalty

New frequency penalty value, or existing value if not specified

maxTokens

New maximum token count, or existing value if not specified

presencePenalty

New presence penalty value, or existing value if not specified

responseFormat

New response format, or existing value if not specified

stop

New stop reason, or existing value if not specified

stream

New streaming setting, or existing value if not specified

streamOptions

New stream options, or existing value if not specified

temperature

New temperature value, or existing value if not specified

topP

New top-p value, or existing value if not specified

tools

New tools list, or existing value if not specified

toolChoice

New tool choice, or existing value if not specified

logprobs

New log probabilities setting, or existing value if not specified

topLogprobs

New top log probabilities count, or existing value if not specified