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

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 delivers exceptional performance 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 transform 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 the Tencent Hunyuan Large Language Model service 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 standards. 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 the default environment variables are used for initialization, the function attempts 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 Tencent Hunyuan embedding model.
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 where the API Key is located (default: HUNYUAN_API_KEY)