Skip to content

LanguageModelCallOptions

Namespace: Vercel.AI.Provider

public sealed class LanguageModelCallOptions

Settings for one language-model call. Property names follow the V4 call options.

Inheritance: object

View source

public AbortSignal? AbortSignal { get; set; }

Aborts when the call is aborted. It carries the reason, for example a TimeoutError for an expired timeout. Set only when the call has a timeout or a AbortSignal. The CancellationToken of the call is cancelled at the same time. Maps to abortSignal.

Value: AbortSignal

View source

public double? FrequencyPenalty { get; set; }

Frequency penalty.

Value: double?

View source

public IReadOnlyDictionary<string, string?>? Headers { get; set; }

Extra HTTP headers for this call.

Value: IReadOnlyDictionary<string, string>

View source

public bool IncludeRawChunks { get; set; }

When true, the stream includes one raw provider chunk for each event.

Value: bool

View source

public bool JsonResponse { get; set; }

Asks for a JSON response without a schema. Maps to responseFormat: { type: 'json' } with no schema. Providers send json_object or the matching format. Ignored when JsonSchema is set.

Value: bool

View source

public JsonElement? JsonSchema { get; set; }

JSON schema when structured output is requested.

Value: JsonElement?

View source

public string? JsonSchemaDescription { get; set; }

Response format description. Maps to responseFormat.description.

Value: string

View source

public string? JsonSchemaName { get; set; }

Schema name sent to providers that require one.

Value: string

View source

public int? MaxOutputTokens { get; set; }

Maximum tokens to generate. Maps to maxOutputTokens.

Value: int?

View source

public double? PresencePenalty { get; set; }

Presence penalty.

Value: double?

View source

public IReadOnlyList<ModelMessage> Prompt { get; set; }

Prompt messages.

Value: IReadOnlyList<ModelMessage>

View source

public IReadOnlyDictionary<string, JsonElement>? ProviderOptions { get; set; }

Provider-specific options, keyed by provider name.

Value: IReadOnlyDictionary<string, JsonElement>

View source

public string? Reasoning { get; set; }

Reasoning effort for providers that accept it: none, minimal, low, medium, high, xhigh, or max.

Value: string

View source

public int? Seed { get; set; }

Random seed.

Value: int?

View source

public IReadOnlyList<string>? StopSequences { get; set; }

Stop sequences.

Value: IReadOnlyList<string>

View source

public double? Temperature { get; set; }

Sampling temperature.

Value: double?

View source

public ToolChoice? ToolChoice { get; set; }

Tool selection mode.

Value: ToolChoice

View source

public IReadOnlyList<LanguageModelTool>? Tools { get; set; }

Tools the model may call.

Value: IReadOnlyList<LanguageModelTool>

View source

public int? TopK { get; set; }

Top-k sampling.

Value: int?

View source

public double? TopP { get; set; }

Nucleus sampling.

Value: double?

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product