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?"

如果您有改進的建議,請隨意打開問題或提交拉請請求。