目前agent infra及rag框架已经搭好
This commit is contained in:
1 parent
87ee138fb5
commit
447f313217
38 files changed
+1431
-790
No files matched your search
@@ -1,32 +1,36 @@
|
||||
# 进入项目目录并提交代码(Windows 下路径为 .\Agent\)
|
||||
# Agent Web Chat
|
||||
|
||||
基于 LangGraph 的多模态对话 Agent,支持文本、图片、音频输入,具备屏幕截图、浏览器控制、RAG 知识库、数据库查询等工具调用能力。
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 1. 克隆仓库并进入项目目录
|
||||
|
||||
```bash
|
||||
git clone <your-repo-url>
|
||||
cd Agent
|
||||
git add .
|
||||
git commit -m "修改内容的说明"
|
||||
git push
|
||||
|
||||
# 创建并激活虚拟环境(Linux/macOS 用 source,Windows 用 myenv\Scripts\activate)
|
||||
Windows:
|
||||
bash
|
||||
python -m venv myenv
|
||||
source myenv/bin/activate || myenv/Scripts/activate
|
||||
.\myenv\Scripts\activate
|
||||
macOS / Linux:
|
||||
bash
|
||||
python -m venv myenv
|
||||
source myenv/bin/activate
|
||||
|
||||
# 升级 pip 并安装核心依赖
|
||||
python -m pip install --upgrade pip
|
||||
pip install -U langchain langchain-openai python-dotenv
|
||||
|
||||
# 以可编辑模式安装当前项目(配置见 pyproject.toml)
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install -e .
|
||||
|
||||
# 安装 LangGraph CLI(开发模式)
|
||||
pip install "langgraph-cli[inmem]"
|
||||
|
||||
# 可选:安装数据库相关依赖(psycopg2-binary 用于 PostgreSQL)
|
||||
pip install sqlalchemy pymysql loguru psycopg2-binary
|
||||
|
||||
# 环境变量配置
|
||||
# Copy .env.example to .env and fill in the required values before running the app.
|
||||
cp .env.example .env
|
||||
|
||||
# 必须填写的变量:
|
||||
# .env.example
|
||||
gedit .env
|
||||
必须填写的变量:
|
||||
LLM_BASE_URL – 大模型 API 基础地址
|
||||
LLM_API_KEY – API 密钥
|
||||
LLM_MODEL – 模型名称(如 Qwen/Qwen2.5-72B-Instruct)
|
||||
TTS_BASE_URL – 文本转语音服务地址(可选,若不使用音频回复可不填)
|
||||
ASR_BASE_URL – 语音识别服务地址(可选)
|
||||
RAG_BASE_URL – RAG 嵌入与重排序服务地址(可选)
|
||||
|
||||
# 启动 Web 对话服务(推荐)
|
||||
# 确保在 Agent 目录下,且 PYTHONPATH 包含 src 目录
|
||||
@@ -35,8 +39,11 @@ export PYTHONPATH=src:$PYTHONPATH # Linux/macOS
|
||||
# 或 Windows PowerShell: $env:PYTHONPATH="src;$env:PYTHONPATH"
|
||||
uvicorn agent.web.server:app --host 127.0.0.1 --port 8765
|
||||
|
||||
# API 为两阶段调用:POST /api/chat/start(落盘用户消息) + POST /api/chat/complete(推理)
|
||||
# 前端已按此顺序调用。
|
||||
|
||||
# (可选)通过 Cloudflare Tunnel 暴露公网
|
||||
cloudflared tunnel --url http://localhost:8765
|
||||
cloudflared tunnel --url http://localhost:8765
|
||||
|
||||
# 进入项目目录并提交代码(Windows 下路径为 .\Agent\)
|
||||
cd Agent
|
||||
git add .
|
||||
git commit -m "修改内容的说明"
|
||||
git push
|
||||
Reference in new issue
Block a user