SubquadraticChatLanguageModel
Namespace: Vercel.AI.Subquadratic
public sealed class SubquadraticChatLanguageModel : ILanguageModelSubQ 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
Constructors
Section titled “Constructors”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 |
Properties
Section titled “Properties”ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id, such as openai.
Value: string
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Always V4.
Value: string
SupportedUrls
Section titled “SupportedUrls”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>
Methods
Section titled “Methods”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
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>
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>
Serialize()
Section titled “Serialize()”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
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product