Tencent Hunyuan
Tencent Hunyuan is a general-purpose large language model developed by Tencent. It performs well on content generation, math and logic, code generation, and multi-turn dialogue. The embedding API (GetEmbedding) converts input text into 1024-dimensional vectors for RAG, agent memory, and other applications that rely on semantic understanding. seekdb provides TencentHunyuanEmbeddingFunction so you can use these embeddings with seekdb collections.
Using Tencent Hunyuan service requires you to follow Tencent Cloud's pricing rules and may incur corresponding fees. Before proceeding, please visit their official website or refer to relevant documentation to confirm and accept their pricing standards. If you do not agree, please do not proceed.
Dependencies and authentication
- Install the
@seekdb/tencent-hunyuanpackage. - Create a Tencent Hunyuan API key for authentication.
Example: create a Tencent Hunyuan embedding function
Call the TencentHunyuanEmbeddingFunction constructor with an optional config object. Without config, the function reads the API key from the default environment variable HUNYUAN_API_KEY.
import { TencentHunyuanEmbeddingFunction } from "@seekdb/tencent-hunyuan";
const ef = new TencentHunyuanEmbeddingFunction({
// Specify the Tencent Hunyuan embedding model.
modelName: "hunyuan-embedding",
});
Configurations:
- modelName: Tencent Hunyuan embedding model name (default:
hunyuan-embedding). - api_key_env: Environment variable name for the API key (default:
HUNYUAN_API_KEY).