Our new LangChain Academy Course Deep Research with LangGraph is now live! Enroll for free.
OSS (v1-alpha)
LangChain and LangGraph
# Install the package %pip install --upgrade --quiet volcengine
from langchain_community.chat_models import VolcEngineMaasChat from langchain_core.messages import HumanMessage
chat = VolcEngineMaasChat(volc_engine_maas_ak="your ak", volc_engine_maas_sk="your sk")
export VOLC_ACCESSKEY=YOUR_AK export VOLC_SECRETKEY=YOUR_SK
chat([HumanMessage(content="给我讲个笑话")])
AIMessage(content='好的,这是一个笑话:\n\n为什么鸟儿不会玩电脑游戏?\n\n因为它们没有翅膀!')
chat = VolcEngineMaasChat( volc_engine_maas_ak="your ak", volc_engine_maas_sk="your sk", streaming=True, )
AIMessage(content='好的,这是一个笑话:\n\n三岁的女儿说她会造句了,妈妈让她用“年轻”造句,女儿说:“妈妈减肥,一年轻了好几斤”。')