copy

fun copy(model: ChatModel = this.model, instructions: String? = this.instructions, reasoning: ReasoningConfig? = this.reasoning, maxOutputTokens: Int? = this.maxOutputTokens, stream: Boolean? = this.stream, temperature: Double? = this.temperature, topP: Double? = this.topP, text: TextConfig? = this.text, tools: List<ResponseTool>? = this.tools, toolChoice: ResponseToolChoice? = this.toolChoice, topLogprobs: Int? = this.topLogprobs, user: String? = this.user): ResponseParams

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

Unlike the chat and FIM parameters, the copy is validated exactly like a freshly built one.

Example:

val streaming = params.copy(stream = true)

Return

A new ResponseParams instance with the specified changes

Parameters

model

New model, or the existing one if not specified

instructions

New system-level instruction, or the existing one if not specified

reasoning

New thinking-mode configuration, or the existing one if not specified

maxOutputTokens

New output ceiling, or the existing one if not specified

stream

New streaming setting, or the existing one if not specified

temperature

New temperature, or the existing one if not specified

topP

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

text

New output shape, or the existing one if not specified

tools

New tool list, or the existing one if not specified

toolChoice

New tool choice, or the existing one if not specified

topLogprobs

New log-probability count, or the existing one if not specified

user

New end-user identifier, or the existing one if not specified