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), 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 Tencent Hunyuan Large Language Model services requires compliance with Tencent Cloud's billing rules, which 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 pyseekdb library has been installed.
-
Create a Tencent Hunyuan API Key for authentication.
Example: Create a Tencent Hunyuan Embedding Function
Import and initialize TencentHunyuanEmbeddingFunction in your code. Typically, authentication information is managed through environment variables.
-
Basic usage
Initialize with default environment variables. The function attempts to read the API key from the default environment variable named
HUNYUAN_API_KEYfor authentication.from pyseekdb.utils.embedding_functions import TencentHunyuanEmbeddingFunction
ef = TencentHunyuanEmbeddingFunction() -
Custom configuration
You can specify custom environment variable names using
secret_id_envandsecret_key_env, and pass in other optional parameters.from pyseekdb.utils.embedding_functions import TencentHunyuanEmbeddingFunction
ef = TencentHunyuanEmbeddingFunction(
api_key_env="HUNYUAN_API_KEY",
timeout=30
)
Parameter description:
-
model_name: The name of the Tencent Hunyuan model. -
api_key_env: The name of the environment variable containing the API Key. Default isHUNYUAN_API_KEY. -
timeout: Request timeout period (seconds), optional.