langserve assistant ui
1.0.0
一个演示项目,将Langserve,Langgraph和Fastapi结合在一起,以使用现代UI创建AI代理。该项目使用Assistant-UI和Next.js Vercel AI SDK用于无缝聊天界面。
该项目展示:
langserve-assistant-ui/
├── backend/ # FastAPI + LangServe server
└── frontend/ # Next.js + assistant-ui client
转到./backend并创建.env文件。按照.env.example中的示例。
后端是使用Langchain CLI构建的,并利用Langgraph的create_react_agent进行代理创建。
cd backend
poetry install
poetry run python -m app.server使用Assistant-UI CLI工具生成前端,并使用Assistant-UI的线程组件实现Vercel AI SDK的USECHAT挂钩。
cd frontend
yarn install
yarn dev您可以使用简单的提示直接查询工具:
Example: "What is the stock price of Apple?"

代理可以处理需要多个步骤的更复杂的查询:
Example: "What is the weather in San Francisco?"

如果您有改进的建议,请随意打开问题或提交拉请请求。