基本信息
- LangGraph实现agent的流媒体stream_mode参数设置,流式传输工具更新(没太懂)
- 模型调用通义千问(阿里Tongyi大模型)
agent流模式运行方式
可以通过将流模式作为列表传递来指定多种流模式
- updates 持续更新最终的输出
- messages 流式间断输出
- custom 自定义值打印
运行示例
# -*- coding: utf-8 -*-
from langgraph.prebuilt import create_react_agent
from langchain_community.chat_models.tongyi import ChatTongyi #dashscope
from pydantic import BaseModel
import asyncio
from langgraph.config import get_stream_writer
#模型初始化
llm = ChatTongyi(
model="qwen-turbo",#qwen-max-latest qwen-plus
temperature=0,
verbose=

最低0.47元/天 解锁文章
1422

被折叠的 条评论
为什么被折叠?



