Skip to content

SubquadraticChatLanguageModel

Namespace: Vercel.AI.Subquadratic

public sealed class SubquadraticChatLanguageModel : ILanguageModel

SubQ chat completions over the OpenAI-compatible protocol. The model keeps its serializable settings and rebuilds the OpenAI-compatible model from them, so the URL and request adapters survive workflow serialization. Maps to SubquadraticChatLanguageModel.

Inheritance: object

Implements: ILanguageModel

View source

SubquadraticChatLanguageModel(SubquadraticProvider, string)

Section titled “SubquadraticChatLanguageModel(SubquadraticProvider, string)”
public SubquadraticChatLanguageModel(SubquadraticProvider provider, string modelId)

Creates a chat model. <code class=“paramref”>modelId</code> may be a model id this library does not know yet.

Parameters

Name Type Description
provider SubquadraticProvider
modelId string

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id, such as openai.

Value: string

View source

public string SpecificationVersion { get; }

Always V4.

Value: string

View source

public IReadOnlyDictionary<string, string> SupportedUrls { get; }

URLs the model can read itself, keyed by media type pattern (such as image/*). Each value is a regular expression that a URL must match. Prompt file URLs that match are passed through. All others are downloaded before the call. Maps to supportedUrls.

Value: IReadOnlyDictionary<string, string>

View source

Deserialize(SerializedModelOptions, HttpClient?)

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

Restores a model from Serialize(). Maps to [WORKFLOW_DESERIALIZE]. Pass <code class=“paramref”>httpClient</code> to send the requests through a custom handler.

Parameters

Name Type Description
options SerializedModelOptions
httpClient HttpClient

Returns: SubquadraticChatLanguageModel

View source

DoGenerateAsync(LanguageModelCallOptions, CancellationToken)

Section titled “DoGenerateAsync(LanguageModelCallOptions, CancellationToken)”
public Task<LanguageModelGenerateResult> DoGenerateAsync(LanguageModelCallOptions options, CancellationToken cancellationToken)

Generates a complete result.

Parameters

Name Type Description
options LanguageModelCallOptions
cancellationToken CancellationToken

Returns: Task<LanguageModelGenerateResult>

View source

DoStreamAsync(LanguageModelCallOptions, CancellationToken)

Section titled “DoStreamAsync(LanguageModelCallOptions, CancellationToken)”
public Task<LanguageModelStreamResult> DoStreamAsync(LanguageModelCallOptions options, CancellationToken cancellationToken)

Streams partial results. The result carries the stream with the request and response info.

Parameters

Name Type Description
options LanguageModelCallOptions
cancellationToken CancellationToken

Returns: Task<LanguageModelStreamResult>

View source

public SerializedModelOptions Serialize()

Serializes the model id, the endpoint, and the resolved request headers (including authentication) for a workflow boundary. Maps to [WORKFLOW_SERIALIZE]. The HTTP client is not serialized.

Returns: SerializedModelOptions

View source

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