Skip to main content
Open In ColabOpen on GitHub

Tencent Hunyuan

Tencent's hybrid model API (Hunyuan API) implements dialogue communication, content generation, analysis and understanding, and can be widely used in various scenarios such as intelligent customer service, intelligent marketing, role playing, advertising copywriting, product description, script creation, resume generation, article writing, code generation, data analysis, and content analysis.

See for more information.

from langchain_community.chat_models import ChatHunyuan
from langchain_core.messages import HumanMessage
API Reference:ChatHunyuan | HumanMessage
chat = ChatHunyuan(
hunyuan_app_id=111111111,
hunyuan_secret_id="YOUR_SECRET_ID",
hunyuan_secret_key="YOUR_SECRET_KEY",
)
chat(
[
HumanMessage(
content="You are a helpful assistant that translates English to French.Translate this sentence from English to French. I love programming."
)
]
)
AIMessage(content="J'aime programmer.")

For ChatHunyuan with Streamingโ€‹

chat = ChatHunyuan(
hunyuan_app_id="YOUR_APP_ID",
hunyuan_secret_id="YOUR_SECRET_ID",
hunyuan_secret_key="YOUR_SECRET_KEY",
streaming=True,
)
chat(
[
HumanMessage(
content="You are a helpful assistant that translates English to French.Translate this sentence from English to French. I love programming."
)
]
)
AIMessageChunk(content="J'aime programmer.")

Was this page helpful?

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy