Skip to content

TencentChatLanguageModel

Namespace: Vercel.AI.Tencent

public sealed class TencentChatLanguageModel : OpenAICompatibleLanguageModel, ILanguageModel

TokenHub chat completions over the OpenAI-compatible protocol. Serializes its own config because the URL is rebuilt from the base URL when the model is restored.

Inheritance: object → OpenAICompatibleLanguageModel

Implements: ILanguageModel

View source

TencentChatLanguageModel(TencentProvider, string)

Section titled “TencentChatLanguageModel(TencentProvider, string)”
public TencentChatLanguageModel(TencentProvider provider, string modelId)

Creates a model.

Parameters

Name Type Description
provider TencentProvider
modelId string

View source

Deserialize(SerializedModelOptions, string?, HttpMessageHandler?)

Section titled “Deserialize(SerializedModelOptions, string?, HttpMessageHandler?)”
public static TencentChatLanguageModel Deserialize(SerializedModelOptions serialized, string? apiKey = null, HttpMessageHandler? handler = null)

Restores a model from Serialize(). Maps to [WORKFLOW_DESERIALIZE].

Parameters

Name Type Description
serialized SerializedModelOptions The serialized model id and config.
apiKey string API key. Defaults to the TENCENT_TOKENHUB_API_KEY environment variable.
handler HttpMessageHandler HTTP handler. Pass one from tests.

Returns: TencentChatLanguageModel

View source

public SerializedModelOptions Serialize()

Serializes the model id and config for a workflow boundary. Maps to [WORKFLOW_SERIALIZE]. The API key is not part of the serialized config. Pass it to HttpMessageHandler).

Returns: SerializedModelOptions

View source

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