AlibabaProvider
Namespace: Vercel.AI.Alibaba
public sealed class AlibabaProvider : OpenAICompatibleProviderAlibaba provider. OpenAI Chat Completions compatible at https://dashscope-intl.aliyuncs.com/compatible-mode/v1.
Inheritance: object → ProviderBase → OpenAICompatibleProvider
Constructors
Section titled “Constructors”AlibabaProvider(HttpClient, OpenAICompatibleOptions?)
Section titled “AlibabaProvider(HttpClient, OpenAICompatibleOptions?)”public AlibabaProvider(HttpClient httpClient, OpenAICompatibleOptions? options = null)Creates a provider.
Parameters
| Name | Type | Description |
|---|---|---|
httpClient |
HttpClient | |
options |
OpenAICompatibleOptions |
Fields
Section titled “Fields”ApiKeyVariable
Section titled “ApiKeyVariable”public const string ApiKeyVariable = "ALIBABA_API_KEY"Environment variable for the API key.
Value: string
DefaultBaseUrl
Section titled “DefaultBaseUrl”public const string DefaultBaseUrl = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"Default API origin.
Value: string
EmbeddingBaseUrl
Section titled “EmbeddingBaseUrl”public const string EmbeddingBaseUrl = "https://dashscope-intl.aliyuncs.com/api/v1"Native DashScope embedding origin.
Value: string
ProviderId
Section titled “ProviderId”public const string ProviderId = "alibaba"Provider id.
Value: string
Methods
Section titled “Methods”Create(OpenAICompatibleOptions?, HttpMessageHandler?)
Section titled “Create(OpenAICompatibleOptions?, HttpMessageHandler?)”public static AlibabaProvider Create(OpenAICompatibleOptions? options = null, HttpMessageHandler? handler = null)Creates a provider. Pass a handler from tests.
Parameters
| Name | Type | Description |
|---|---|---|
options |
OpenAICompatibleOptions | |
handler |
HttpMessageHandler |
Returns: AlibabaProvider
EmbeddingModel(string)
Section titled “EmbeddingModel(string)”public override IEmbeddingModel EmbeddingModel(string modelId)Returns an embedding model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IEmbeddingModel
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product