Wrapper around Tencent Hunyuan large language models that use the Chat endpoint.

To use you should have the TENCENT_SECRET_ID and TENCENT_SECRET_KEY environment variable set.

const messages = [new HumanMessage("Hello")];

const hunyuanLite = new ChatTencentHunyuan({
model: "hunyuan-lite",
tencentSecretId: "YOUR-SECRET-ID",
tencentSecretKey: "YOUR-SECRET-KEY",
});

let res = await hunyuanLite.call(messages);

const hunyuanPro = new ChatTencentHunyuan({
model: "hunyuan-pro",
temperature: 1,
tencentSecretId: "YOUR-SECRET-ID",
tencentSecretKey: "YOUR-SECRET-KEY",
});

res = await hunyuanPro.call(messages);

Hierarchy

  • ChatTencentHunyuan
    • ChatTencentHunyuan

Constructors

Properties

host: string = "hunyuan.tencentcloudapi.com"

Tencent Cloud API Host.

"hunyuan.tencentcloudapi.com"
model: string = "hunyuan-pro"

Model name to use.

"hunyuan-pro"
sign: sign

Tencent Cloud API v3 sign method.

streaming: boolean = false

Whether to stream the results or not. Defaults to false.

false
temperature?: number

Amount of randomness injected into the response. Ranges from 0.0 to 2.0. Use temp closer to 0 for analytical / multiple choice, and temp closer to 1 for creative and generative tasks. Defaults to 1.0.95.

tencentSecretId?: string

SecretID to use when making requests, can be obtained from https://console.cloud.tencent.com/cam/capi. Defaults to the value of TENCENT_SECRET_ID environment variable.

tencentSecretKey?: string

Secret key to use when making requests, can be obtained from https://console.cloud.tencent.com/cam/capi. Defaults to the value of TENCENT_SECRET_KEY environment variable.

topP?: number

Total probability mass of tokens to consider at each step. Range from 0 to 1.0. Defaults to 1.0.

Accessors

Methods