Skip to main content
Baichuan Intelligent Technology의 Baichuan 채팅 모델 API입니다. 자세한 정보는 https://platform.baichuan-ai.com/docs/api를 참조하세요.
from langchain_community.chat_models import ChatBaichuan
from langchain.messages import HumanMessage
chat = ChatBaichuan(baichuan_api_key="YOUR_API_KEY")
또는 다음과 같이 API 키를 설정할 수 있습니다:
import os

os.environ["BAICHUAN_API_KEY"] = "YOUR_API_KEY"
chat([HumanMessage(content="我日薪8块钱,请问在闰年的二月,我月薪多少")])
AIMessage(content='首先,我们需要确定闰年的二月有多少天。闰年的二月有29天。\n\n然后,我们可以计算你的月薪:\n\n日薪 = 月薪 / (当月天数)\n\n所以,你的月薪 = 日薪 * 当月天数\n\n将数值代入公式:\n\n月薪 = 8元/天 * 29天 = 232元\n\n因此,你在闰年的二月的月薪是232元。')

스트리밍을 사용한 Baichuan-192K 채팅

chat = ChatBaichuan(
    baichuan_api_key="YOUR_API_KEY",
    streaming=True,
)
chat([HumanMessage(content="我日薪8块钱,请问在闰年的二月,我月薪多少")])
AIMessageChunk(content='首先,我们需要确定闰年的二月有多少天。闰年的二月有29天。\n\n然后,我们可以计算你的月薪:\n\n日薪 = 月薪 / (当月天数)\n\n所以,你的月薪 = 日薪 * 当月天数\n\n将数值代入公式:\n\n月薪 = 8元/天 * 29天 = 232元\n\n因此,你在闰年的二月的月薪是232元。')

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I