Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
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 intelligentcustomer service, intelligent marketing, role playing, advertising copywriting, product description,script creation, resume generation, article writing, code generation, data analysis, and contentanalysis.

Seemore information for more details.

from langchain_community.chat_modelsimport ChatHunyuan
from langchain_core.messagesimport 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.")

Using 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.")

Related


[8]ページ先頭

©2009-2025 Movatter.jp