メインコンテンツまでスキップ
バージョン: V1.2.0

Tencent Hunyuan Large Language Model

Tencent Hunyuan Large Language Model (Tencent Hunyuan) is a large language model independently developed end-to-end by Tencent. It excels in high-quality content creation, mathematical logic, code generation, and multi-turn dialogue. Its Embedding interface (GetEmbedding), which is part of the Tencent Hunyuan API, can convert input text into high-quality 1024-dimensional vector data, providing robust semantic understanding capabilities for building applications such as RAG systems and agent memory libraries.

ヒント

Using Tencent Hunyuan Large Language Model services is subject to Tencent Cloud's billing rules and may incur fees. Before proceeding, visit its official website or consult relevant documentation to confirm and accept its pricing terms. If you do not agree, please do not continue.

Dependencies and Authentication​

  • The @seekdb/tencent-hunyuan package has been installed.

  • Create a Tencent Hunyuan API Key for authentication.

Example: Create a Tencent Hunyuan Embedding Function​

Call the new TencentHunyuanEmbeddingFunction() constructor and pass in a configuration object to initialize the embedding function. If default environment variables are used for initialization, the function will attempt to read the API key from the default environment variable named HUNYUAN_API_KEY for authentication.

import { TencentHunyuanEmbeddingFunction } from "@seekdb/tencent-hunyuan";

const ef = new TencentHunyuanEmbeddingFunction",

// Specify the embedding model for Tencent Hunyuan.
modelName: "hunyuan-embedding",
});

Parameter Description:

  • modelName: The name of the Tencent Hunyuan model (Default: hunyuan-embedding)
  • api_key_env: The name of the environment variable containing the API Key (Default: HUNYUAN_API_KEY)