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

Tencent Hunyuan Large Language Model

Tencent Hunyuan Large Language Model (Tencent Hunyuan) is a large language model independently developed by Tencent across the entire chain. 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 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 banks.

ヒント

Using the Tencent Hunyuan Large Language Model service requires compliance with Tencent Cloud's billing rules, which may incur fees. Before proceeding, please visit its official website or consult the 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 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 of 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 where the API Key is located (default: HUNYUAN_API_KEY)