Skip to content

ILanguageModelV4

Namespace: E2E.Decision.Sdk

public interface ILanguageModelV4

The AI SDK’s LanguageModelV4 (language-model/v4/language-model-v4.ts): a language model that implements the language model interface version 4.

View source

string ModelId { get; }

The provider-specific model ID.

Value: string

string Provider { get; }

The provider ID.

Value: string

string SpecificationVersion { get; }

The language model interface version the model implements: v4.

Value: string

IReadOnlyDictionary<string, IReadOnlyList<Regex>> SupportedUrls { get; }

Supported URL patterns by media type: the keys are media type patterns or full media types (*/*, audio/*, application/pdf) and the values are the patterns that match the lower-case URLs. A matched URL is supported natively by the model and is not downloaded.

Value: IReadOnlyDictionary<string, IReadOnlyList<Regex>>

DoGenerateAsync(LanguageModelV4CallOptions, CancellationToken)

Section titled “DoGenerateAsync(LanguageModelV4CallOptions, CancellationToken)”
Task<LanguageModelV4GenerateResult> DoGenerateAsync(LanguageModelV4CallOptions options, CancellationToken cancellationToken = default)

Generates a language model output (non-streaming).

Parameters

Name Type Description
options LanguageModelV4CallOptions
cancellationToken CancellationToken

Returns: Task<LanguageModelV4GenerateResult>

DoStreamAsync(LanguageModelV4CallOptions, CancellationToken)

Section titled “DoStreamAsync(LanguageModelV4CallOptions, CancellationToken)”
Task<LanguageModelV4StreamResult> DoStreamAsync(LanguageModelV4CallOptions options, CancellationToken cancellationToken = default)

Generates a language model output (streaming).

Parameters

Name Type Description
options LanguageModelV4CallOptions
cancellationToken CancellationToken

Returns: Task<LanguageModelV4StreamResult>