Skip to content

ScaleDownExtractionModel

Namespace: Vercel.AI.ScaleDown

public sealed class ScaleDownExtractionModel : IExtractionCaller

Extracts text fields and lists through the ScaleDown /v1/chat/completions route. Maps to ScaleDownExtractionModel.

Inheritance: object

Implements: IExtractionCaller

View source

ScaleDownExtractionModel(string, ScaleDownExtractionModelConfig?)

Section titled “ScaleDownExtractionModel(string, ScaleDownExtractionModelConfig?)”
public ScaleDownExtractionModel(string modelId, ScaleDownExtractionModelConfig? config = null)

Creates an extraction model. <code class=“paramref”>modelId</code> may be extract, extract-1, or an id this library does not know yet.

Parameters

Name Type Description
modelId string
config ScaleDownExtractionModelConfig

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; }

Field types this model can extract. Unsupported types are rejected before any provider I/O.

Value: IReadOnlyList<string>

View source

Deserialize(SerializedModelOptions, HttpClient?)

Section titled “Deserialize(SerializedModelOptions, HttpClient?)”
public static ScaleDownExtractionModel Deserialize(SerializedModelOptions options, HttpClient? httpClient = null)

Restores a model from Serialize(). When no headers were serialized, authentication is read from SCALEDOWN_API_KEY at call time. Maps to WORKFLOW_DESERIALIZE.

Parameters

Name Type Description
options SerializedModelOptions
httpClient HttpClient

Returns: ScaleDownExtractionModel

View source

DoExtractAsync(ExtractionModelCall, CancellationToken)

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

Extracts every field from the same state. No partial results.

Parameters

Name Type Description
call ExtractionModelCall
cancellationToken CancellationToken

Returns: Task<ExtractionModelResult>

View source

public SerializedModelOptions Serialize()

Serializes the model id and the JSON-serializable part of the config for a workflow boundary. Maps to WORKFLOW_SERIALIZE.

Returns: SerializedModelOptions

View source

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