ituoke/agent/README.md

32 lines
917 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Python Agent(独立进程)
此目录目前为独立实验骨架。桌面应用的模型配置和真实对话已经由
`internal/agent/` 中的 Go 服务实现,不需要启动本 Python 进程。
> **[关键]** 模型理解、下一步规划、工具调用、审计日志都放这里。
> Go 通过 `internal/agent/client.go` 以 JSON-RPC(`POST /rpc`)调用本进程。
## 协议
- 版本常量:与 Go 侧 `internal/protocol.Version` 保持一致(当前 `1.0`)
- 默认地址:`127.0.0.1:17890`
- 消息结构:见 `internal/protocol/messages.go`
## 本地运行(开发)
```bash
cd agent
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py
```
## 方法
| method | 说明 |
|--------|------|
| `agent.health` | 健康检查 |
| `agent.chat` | 对话(可先接云端 API) |
| `agent.plan_next` | 看图 + 上下文 → 设备动作列表 |