TencentProvider
Namespace: Vercel.AI.Tencent
public sealed class TencentProvider : OpenAICompatibleProviderTencent Cloud provider: TokenHub chat models (OpenAI-compatible) and Kling (TokenHub) and VOD AIGC video models.
Inheritance: object → ProviderBase → OpenAICompatibleProvider
Constructors
Section titled “Constructors”TencentProvider(HttpClient, OpenAICompatibleOptions?)
Section titled “TencentProvider(HttpClient, OpenAICompatibleOptions?)”public TencentProvider(HttpClient httpClient, OpenAICompatibleOptions? options = null)Creates a provider. Pass TencentOptions to use VOD video models.
Credentials are read when a request is sent, so a missing key fails then and not here.
Parameters
| Name | Type | Description |
|---|---|---|
httpClient |
HttpClient | |
options |
OpenAICompatibleOptions |
Fields
Section titled “Fields”DefaultBaseUrl
Section titled “DefaultBaseUrl”public const string DefaultBaseUrl = "https://tokenhub-intl.tencentcloudmaas.com/v1"Default TokenHub API origin.
Value: string
DefaultVodBaseUrl
Section titled “DefaultVodBaseUrl”public const string DefaultVodBaseUrl = "https://vod.intl.tencentcloudapi.com"Default VOD API origin.
Value: string
ProviderId
Section titled “ProviderId”public const string ProviderId = "tencent"Provider id.
Value: string
Methods
Section titled “Methods”Chat(string)
Section titled “Chat(string)”public ILanguageModel Chat(string modelId)Creates a TokenHub model for text generation.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ILanguageModel
Create(OpenAICompatibleOptions?, HttpMessageHandler?)
Section titled “Create(OpenAICompatibleOptions?, HttpMessageHandler?)”public static TencentProvider Create(OpenAICompatibleOptions? options = null, HttpMessageHandler? handler = null)Creates a provider.
Parameters
| Name | Type | Description |
|---|---|---|
options |
OpenAICompatibleOptions | Provider options. |
handler |
HttpMessageHandler | Optional message handler. The provider follows redirects by hand so a status poll cannot send the credentials to another host. It sets AllowAutoRedirect = false on a supplied handler that exposes it (see HttpMessageHandler)). |
Returns: TencentProvider
CreateChatModel(string)
Section titled “CreateChatModel(string)”public override OpenAICompatibleLanguageModel CreateChatModel(string modelId)Creates a chat model. Providers override this when support differs by model id.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: OpenAICompatibleLanguageModel
EmbeddingModel(string)
Section titled “EmbeddingModel(string)”public override IEmbeddingModel EmbeddingModel(string modelId)Returns an embedding model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IEmbeddingModel
ImageModel(string)
Section titled “ImageModel(string)”public override IImageModel ImageModel(string modelId)Returns an image model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IImageModel
Video(string)
Section titled “Video(string)”public IVideoModel Video(string modelId)Creates a model for video generation. Same as VideoModel(string).
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IVideoModel
VideoModel(string)
Section titled “VideoModel(string)”public override IVideoModel VideoModel(string modelId)Creates a model for video generation. TokenHub Kling models use their TokenHub id; VOD AIGC models use vod/<ModelName>/<ModelVersion>.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IVideoModel
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product