Skip to content

GatewayExtractionModel

Namespace: Vercel.AI.Gateway

public sealed class GatewayExtractionModel : IExtractionCaller

Extracts typed field values through the Gateway /extraction-model route. Maps to GatewayExtractionModel.

Inheritance: object

Implements: IExtractionCaller

View source

GatewayExtractionModel(GatewayProvider, string)

Section titled “GatewayExtractionModel(GatewayProvider, string)”
public GatewayExtractionModel(GatewayProvider provider, string modelId)

Creates an extraction model.

Parameters

Name Type Description
provider GatewayProvider
modelId string

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

public string SpecificationVersion { get; }

Specification version. Only v4 is accepted.

Value: string

View source

public IReadOnlyList<string> SupportedFieldTypes { get; }

Every field type. Support varies by model, so the Gateway rejects unsupported fields.

Value: IReadOnlyList<string>

View source

DoExtractAsync(ExtractionModelCall, CancellationToken)

Section titled “DoExtractAsync(ExtractionModelCall, CancellationToken)”
public Task<ExtractionModelResult> DoExtractAsync(ExtractionModelCall call, CancellationToken cancellationToken = default)

Sends the state and every field in one request.

Parameters

Name Type Description
call ExtractionModelCall
cancellationToken CancellationToken

Returns: Task<ExtractionModelResult>

View source

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