OpenRouterParams

open class OpenRouterParams(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 logprobs: Boolean? = null, val stop: List<String>? = null, val topLogprobs: Int? = null, val topP: Double? = null, val topK: Int? = null, val repetitionPenalty: Double? = null, val minP: Double? = null, val topA: Double? = null, val transforms: List<String>? = null, val models: List<String>? = null, val route: String? = null, val provider: ProviderPreferences? = null) : LLMParams(source)

OpenRouter chat-completions parameters layered on top of LLMParams.

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, logprobs: Boolean? = null, stop: List<String>? = null, topLogprobs: Int? = null, topP: Double? = null, topK: Int? = null, repetitionPenalty: Double? = null, minP: Double? = null, topA: Double? = null, transforms: List<String>? = null, models: List<String>? = null, route: String? = null, provider: ProviderPreferences? = null)

Properties

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
val minP: Double? = null

Minimum cumulative probability for token inclusion in sampling.

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

List of allowed models for this request.

Link copied to clipboard
Link copied to clipboard
val presencePenalty: Double? = null

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

Link copied to clipboard

Model provider preferences.

Link copied to clipboard

Number in (0.0, 2.0] — penalizes token repetition.

Link copied to clipboard
val route: String? = null

Request routing identifier.

Link copied to clipboard
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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val topA: Double? = null

Temperature scaling based on marginal probability gain.

Link copied to clipboard
val topK: Int? = null

Number of top tokens to consider when generating output (min 1).

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 transforms: List<String>? = null

List of context transforms. Defines how context is transformed when it exceeds the model's token limit. Default is "middle-out" which truncates from the middle of the prompt. Use empty list [] for no transformations.

Link copied to clipboard
val user: String?

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, logprobs: Boolean? = this.logprobs, stop: List<String>? = this.stop, topLogprobs: Int? = this.topLogprobs, topP: Double? = this.topP, topK: Int? = this.topK, repetitionPenalty: Double? = this.repetitionPenalty, minP: Double? = this.minP, topA: Double? = this.topA, transforms: List<String>? = this.transforms, models: List<String>? = this.models, route: String? = this.route, provider: ProviderPreferences? = this.provider): OpenRouterParams

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