Skip to content

GenerateObjectOptions<T>

Namespace: Vercel.AI.GenerateObject

public sealed class GenerateObjectOptions<T>

Options for CancellationToken). Maps to generateObject.

Type parameters

Name Description
T

Inheritance: object

View source

public Func<GenerateObjectRepairContext, CancellationToken, Task<string?>>? ExperimentalRepairText { get; set; }

Deprecated alias of RepairText. Maps to experimental_repairText.

Value: Func<GenerateObjectRepairContext, CancellationToken, Task<string>>

View source

public TelemetryOptions? ExperimentalTelemetry { get; set; }

Deprecated alias of Telemetry. Maps to experimental_telemetry.

Value: TelemetryOptions

View source

public double? FrequencyPenalty { get; set; }

Frequency penalty.

Value: double?

View source

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

Extra headers forwarded to the model.

Value: IReadOnlyDictionary<string, string>

View source

public Instructions? Instructions { get; set; }

Instructions supplied before the prompt.

Value: Instructions

View source

public int? MaxOutputTokens { get; set; }

Maximum output tokens.

Value: int?

View source

public int? MaxRetries { get; set; }

Retries for provider calls made by this request.

Value: int?

View source

public IReadOnlyList<ModelMessage>? Messages { get; set; }

Full prompt messages.

Value: IReadOnlyList<ModelMessage>

View source

public ILanguageModel? Model { get; set; }

Explicit language model. Wins over ModelId.

Value: ILanguageModel

View source

public string? ModelId { get; set; }

Gateway model id such as openai/gpt-4.1-mini.

Value: string

View source

public Func<GenerateObjectEndEvent<T>, CancellationToken, Task>? OnFinish { get; set; }

Called after the object is parsed and validated.

Value: Func<GenerateObjectEndEvent<T>, CancellationToken, Task>

View source

public Func<GenerateObjectStartEvent, CancellationToken, Task>? OnStart { get; set; }

Called before generation begins.

Value: Func<GenerateObjectStartEvent, CancellationToken, Task>

View source

public Func<GenerateObjectStepEndEvent, CancellationToken, Task>? OnStepEnd { get; set; }

Called with the raw model result before the selected text is parsed.

Value: Func<GenerateObjectStepEndEvent, CancellationToken, Task>

View source

public Func<GenerateObjectStepStartEvent, CancellationToken, Task>? OnStepStart { get; set; }

Called immediately before the model call.

Value: Func<GenerateObjectStepStartEvent, CancellationToken, Task>

View source

public double? PresencePenalty { get; set; }

Presence penalty.

Value: double?

View source

public string? Prompt { get; set; }

A single user prompt.

Value: string

View source

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

Provider-specific options.

Value: IReadOnlyDictionary<string, JsonElement>

View source

public string? Reasoning { get; set; }

Reasoning effort.

Value: string

View source

public Func<GenerateObjectRepairContext, CancellationToken, Task<string?>>? RepairText { get; set; }

Attempts to repair text that failed JSON parsing or schema validation.

Value: Func<GenerateObjectRepairContext, CancellationToken, Task<string>>

View source

public string Schema { get; set; }

JSON Schema for the generated object.

Value: string

View source

public string? SchemaDescription { get; set; }

Optional schema description forwarded to the provider.

Value: string

View source

public string? SchemaName { get; set; }

Optional schema name forwarded to the provider.

Value: string

View source

public int? Seed { get; set; }

Random seed.

Value: int?

View source

public JsonSerializerOptions? SerializerOptions { get; set; }

Serializer settings used to materialize <code class=“typeparamref”>T</code>.

Value: JsonSerializerOptions

View source

public string? System { get; set; }

System prompt. Instructions wins when both are set.

Value: string

View source

public TelemetryOptions? Telemetry { get; set; }

Telemetry configuration. Maps to telemetry.

Value: TelemetryOptions

View source

public double? Temperature { get; set; }

Temperature.

Value: double?

View source

public TimeoutConfiguration? Timeout { get; set; }

Total or per-step timeout.

Value: TimeoutConfiguration

View source

public int? TopK { get; set; }

Top-k sampling.

Value: int?

View source

public double? TopP { get; set; }

Top-p sampling.

Value: double?

View source

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