更新readme
This commit is contained in:
+58
-5
@@ -56,27 +56,70 @@ voidbot config path
|
||||
voidbot config open
|
||||
```
|
||||
|
||||
3. Fill in your real API keys and provider settings
|
||||
3. Add a model after installation
|
||||
|
||||
4. Start the CLI
|
||||
The easiest path is to append one provider profile with the built-in command instead of editing JSON by hand.
|
||||
|
||||
For OpenAI:
|
||||
|
||||
```bash
|
||||
voidbot config add-model \
|
||||
--provider openai_chatgpt \
|
||||
--api-key YOUR_OPENAI_API_KEY \
|
||||
--model gpt-4.1-mini \
|
||||
--id openai \
|
||||
--label "OpenAI GPT-4.1 Mini" \
|
||||
--set-default
|
||||
```
|
||||
|
||||
For Zhipu Coding Plan:
|
||||
|
||||
```bash
|
||||
voidbot config add-model \
|
||||
--provider zhipu_coding_plan \
|
||||
--api-key YOUR_ZHIPU_API_KEY \
|
||||
--model glm-4.7 \
|
||||
--id zhipu \
|
||||
--label "Zhipu GLM-4.7" \
|
||||
--set-default
|
||||
```
|
||||
|
||||
For a custom OpenAI-compatible endpoint:
|
||||
|
||||
```bash
|
||||
voidbot config add-model \
|
||||
--provider custom_openai_compatible \
|
||||
--api-key YOUR_API_KEY \
|
||||
--api-base http://localhost:8000/v1 \
|
||||
--model your-model-name \
|
||||
--id local-model \
|
||||
--label "Local Compatible Model" \
|
||||
--set-default
|
||||
```
|
||||
|
||||
After this, the config is written into `~/.voidbot/config.json` or the current project's `config.json`, and VoidBot can connect to that model directly.
|
||||
|
||||
4. Optionally adjust the config manually for advanced fields
|
||||
|
||||
5. Start the CLI
|
||||
|
||||
```bash
|
||||
voidbot
|
||||
```
|
||||
|
||||
5. Run one message
|
||||
6. Run one message
|
||||
|
||||
```bash
|
||||
voidbot --message "Summarize this repository"
|
||||
```
|
||||
|
||||
6. Start the gateway
|
||||
7. Start the gateway
|
||||
|
||||
```bash
|
||||
voidbot gateway
|
||||
```
|
||||
|
||||
7. Inspect SQLite data
|
||||
8. Inspect SQLite data
|
||||
|
||||
```bash
|
||||
voidbot data dump
|
||||
@@ -109,9 +152,17 @@ Key fields:
|
||||
- `providers[].api_base`: optional compatible base URL
|
||||
- `providers[].model`: model name
|
||||
- `providers[].label`: display label
|
||||
- `providers[].context_window_tokens`: optional per-model context window limit
|
||||
- `providers[].max_output_tokens`: optional per-model output reserve
|
||||
- `workspace`: workspace used by tools and context
|
||||
- `database_path`: SQLite database path
|
||||
- `cli_via`: `local` / `gateway` / `auto`
|
||||
- `context_window_tokens`: global default context window
|
||||
- `max_output_tokens`: global default output reserve
|
||||
- `context_warn_threshold_ratio`: warning threshold when nearing the window
|
||||
- `context_compact_threshold_ratio`: threshold that triggers compaction
|
||||
- `context_safety_margin_tokens`: conservative input headroom
|
||||
- `context_compaction_max_rounds`: maximum preflight compaction rounds
|
||||
|
||||
Channel fields:
|
||||
|
||||
@@ -166,5 +217,7 @@ Without `--config`, config lookup order is:
|
||||
|
||||
- The model layer currently focuses on OpenAI-compatible APIs first
|
||||
- Built-in tools are `list_dir`, `read_file`, `write_file`, and `run_command`
|
||||
- When session history approaches the context budget, VoidBot compacts older turns into a summary and keeps the recent active tail
|
||||
- If the provider returns a direct context overflow error, VoidBot tries to compact and retry automatically
|
||||
- `voidbot` starts the interactive CLI by default
|
||||
- `voidbot gateway` starts HTTP and any enabled channel listeners
|
||||
|
||||
+60
-9
@@ -4,11 +4,9 @@
|
||||
|
||||
## 项目简介
|
||||
|
||||
VoidBot 是一个 Python 智能体运行时,设计重点有三点:
|
||||
VoidBot 是一个 Python 智能体
|
||||
|
||||
- 借鉴 `nanobot` 的轻量执行循环与会话持久化思路
|
||||
- 借鉴 `openclaw` 的 provider 兼容层与 gateway/runtime 分层
|
||||
- 保持首版可运行,同时支持 CLI、gateway、SQLite 持久化、多模型配置与会话级切换
|
||||
支持 CLI、gateway、SQLite 持久化、多模型配置与会话级切换
|
||||
|
||||
## 当前能力
|
||||
|
||||
@@ -56,27 +54,70 @@ voidbot config path
|
||||
voidbot config open
|
||||
```
|
||||
|
||||
3. 填写真实的 API Key 与模型配置
|
||||
3. 安装后添加一个模型
|
||||
|
||||
4. 启动 CLI
|
||||
最直接的方式是使用内置命令追加一个 provider 配置,而不是手动编辑 JSON。
|
||||
|
||||
例如添加 OpenAI:
|
||||
|
||||
```bash
|
||||
voidbot config add-model \
|
||||
--provider openai_chatgpt \
|
||||
--api-key YOUR_OPENAI_API_KEY \
|
||||
--model gpt-4.1-mini \
|
||||
--id openai \
|
||||
--label "OpenAI GPT-4.1 Mini" \
|
||||
--set-default
|
||||
```
|
||||
|
||||
例如添加智谱 Coding Plan:
|
||||
|
||||
```bash
|
||||
voidbot config add-model \
|
||||
--provider zhipu_coding_plan \
|
||||
--api-key YOUR_ZHIPU_API_KEY \
|
||||
--model glm-4.7 \
|
||||
--id zhipu \
|
||||
--label "Zhipu GLM-4.7" \
|
||||
--set-default
|
||||
```
|
||||
|
||||
例如添加自定义 OpenAI 兼容接口:
|
||||
|
||||
```bash
|
||||
voidbot config add-model \
|
||||
--provider custom_openai_compatible \
|
||||
--api-key YOUR_API_KEY \
|
||||
--api-base http://localhost:8000/v1 \
|
||||
--model your-model-name \
|
||||
--id local-model \
|
||||
--label "Local Compatible Model" \
|
||||
--set-default
|
||||
```
|
||||
|
||||
执行后,配置会写入 `~/.voidbot/config.json` 或当前项目的 `config.json`,之后就可以直接连接到大模型。
|
||||
|
||||
4. 如有需要,再手动补充或调整配置字段
|
||||
|
||||
5. 启动 CLI
|
||||
|
||||
```bash
|
||||
voidbot
|
||||
```
|
||||
|
||||
5. 单次执行
|
||||
6. 单次执行
|
||||
|
||||
```bash
|
||||
voidbot --message "Summarize this repository"
|
||||
```
|
||||
|
||||
6. 启动 gateway
|
||||
7. 启动 gateway
|
||||
|
||||
```bash
|
||||
voidbot gateway
|
||||
```
|
||||
|
||||
7. 查看 SQLite 数据
|
||||
8. 查看 SQLite 数据
|
||||
|
||||
```bash
|
||||
voidbot data dump
|
||||
@@ -109,9 +150,17 @@ voidbot data dump --session-id main
|
||||
- `providers[].api_base`:可选的兼容接口地址
|
||||
- `providers[].model`:模型名
|
||||
- `providers[].label`:显示名称
|
||||
- `providers[].context_window_tokens`:可选,单个模型的上下文窗口上限
|
||||
- `providers[].max_output_tokens`:可选,单个模型的输出预留上限
|
||||
- `workspace`:工具执行与上下文读取的工作区
|
||||
- `database_path`:SQLite 数据库路径
|
||||
- `cli_via`:`local` / `gateway` / `auto`
|
||||
- `context_window_tokens`:全局默认上下文窗口
|
||||
- `max_output_tokens`:全局默认输出预留
|
||||
- `context_warn_threshold_ratio`:接近窗口时的告警阈值
|
||||
- `context_compact_threshold_ratio`:触发上下文压缩的阈值
|
||||
- `context_safety_margin_tokens`:输入预算的保守余量
|
||||
- `context_compaction_max_rounds`:单次进入模型前最多做几轮压缩
|
||||
|
||||
渠道相关字段:
|
||||
|
||||
@@ -166,5 +215,7 @@ voidbot data dump --session-id main
|
||||
|
||||
- 模型调用层目前优先支持 OpenAI 兼容接口
|
||||
- 内置工具有 `list_dir`、`read_file`、`write_file`、`run_command`
|
||||
- 当历史上下文接近窗口上限时,VoidBot 会把较早的消息压缩为摘要,并保留最近的活动尾部消息
|
||||
- 如果模型直接返回上下文超限错误,VoidBot 会尝试自动压缩并重试
|
||||
- `voidbot` 默认启动交互式 CLI
|
||||
- `voidbot gateway` 启动 HTTP 与已启用渠道监听
|
||||
|
||||
Reference in New Issue
Block a user