OpenAICompatibleCompletionLanguageModel
Namespace: Vercel.AI.OpenAICompatible
public sealed class OpenAICompatibleCompletionLanguageModel : ILanguageModelLegacy Completions language model.
Inheritance: object
Implements: ILanguageModel
Constructors
Section titled “Constructors”OpenAICompatibleCompletionLanguageModel(OpenAICompatibleProvider, string)
Section titled “OpenAICompatibleCompletionLanguageModel(OpenAICompatibleProvider, string)”public OpenAICompatibleCompletionLanguageModel(OpenAICompatibleProvider provider, string modelId)Creates a completion model.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
OpenAICompatibleProvider | |
modelId |
string |
OpenAICompatibleCompletionLanguageModel(OpenAICompatibleProvider, string, string?)
Section titled “OpenAICompatibleCompletionLanguageModel(OpenAICompatibleProvider, string, string?)”public OpenAICompatibleCompletionLanguageModel(OpenAICompatibleProvider provider, string modelId, string? providerId)Creates a completion model with an explicit provider id.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
OpenAICompatibleProvider | |
modelId |
string | |
providerId |
string |
OpenAICompatibleCompletionLanguageModel(OpenAICompatibleProvider, string, string?, string?)
Section titled “OpenAICompatibleCompletionLanguageModel(OpenAICompatibleProvider, string, string?, string?)”public OpenAICompatibleCompletionLanguageModel(OpenAICompatibleProvider provider, string modelId, string? providerId, string? requestModelId)Creates a completion model whose reported ModelId differs from the model sent to the API.
<code class=“paramref”>requestModelId</code>, when set, is used for the request model and the deployment route.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
OpenAICompatibleProvider | |
modelId |
string | |
providerId |
string | |
requestModelId |
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
ProviderOptionsName
Section titled “ProviderOptionsName”public string ProviderOptionsName { get; }Provider-options key. The segment before the first dot of Provider.
Value: string
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Always V4.
Value: string
Methods
Section titled “Methods”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>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product