- 后端:Python (poetry) + fastapi + langchain
- 前端:react + antd prochat + tanstack-router + tailwindcss
- 存储 supabase (本地)
- AI: zhipu(glm-4-flash 模型)
- 自己部署一个 supabase,或者适用免费的额度
- 注册 zhipu 账号,获取 api key
cd backend # 进入后端目录
poetry install
poetry shell # 进入虚拟环境
# 指定环境变量
# 运行环境
poetry run main.py
api_key = your_zhipu_api_key
SUPABASE_KEY = supabase_key
SUPABASE_URL = http://localhost:8000
cd frontend # 进入前端目录
pnpm install
pnpm run dev
- 新建聊天
- 聊天的增删改查
{
"id": "chat_uuid_id",
"title": "your_chat_title",
"content": [
{
"id": "message_uuid_id",
"content": "your_message_content",
"role": "user"
}
]
}