Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit 6985a39

Browse files
author
astrbot-docs-agent[bot]
committed
docs: update for AstrBotDevs/AstrBot#4822
1 parent e9aa976 commit 6985a39

6 files changed

Lines changed: 226 additions & 144 deletions

File tree

en/config/astrbot-config.md

Lines changed: 157 additions & 138 deletions
Large diffs are not rendered by default.

en/dev/star/guides/ai.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ llm_resp = await self.context.tool_loop_agent(
9191

9292
`tool_loop_agent()` method automatically handles the loop of tool invocations and LLM requests until the model stops calling tools or the maximum number of steps is reached.
9393

94+
## Call Tracing (Trace)
95+
96+
> [!TIP]
97+
> Added in v4.5.8
98+
99+
AstrBot provides a Call Tracing (Trace) feature to record model call paths. In a plugin, you can record custom information via `event.trace.record`.
100+
101+
```py
102+
event.trace.record("action_name", key1="value1", key2="value2")
103+
```
104+
105+
These records can be viewed on the "Call Tracing" page in the WebUI.
106+
94107
## Multi-Agent
95108

96109
> [!TIP]
@@ -257,7 +270,7 @@ curr_cid = await conv_mgr.get_curr_conversation_id(uid)
257270
conversation = await conv_mgr.get_conversation(uid, curr_cid) # Conversation
258271
```
259272

260-
::: details Conversation 类型定义
273+
::: details Conversation Type Definition
261274

262275
```py
263276
@dataclass
@@ -438,7 +451,7 @@ persona_mgr = self.context.persona_manager
438451
- **Returns**
439452
`Personality` – Default persona object in v3 format
440453

441-
::: details Persona / Personality 类型定义
454+
::: details Persona / Personality Type Definition
442455

443456
```py
444457

en/use/webui.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ Filter by plugin, type (command / command group / subcommand), permission, and s
4949

5050
You can enable/disable and rename each command.
5151

52+
## Call Tracing (Trace)
53+
54+
Use the `Call Tracing` menu on the left to view AstrBot's model call paths. This is very useful for debugging Agent behavior.
55+
56+
In the top right corner of the page, you can enable or disable trace recording. When enabled, AstrBot records key information during the model call process, such as tool calls and model responses.
57+
58+
> [!NOTE]
59+
> Currently, only some model call paths of the main AstrBot Agent are recorded; this will be continuously improved.
60+
5261
## Updating the Admin Panel
5362

5463
When AstrBot starts, it automatically checks if the admin panel needs updating. If it does, the first log entry (in yellow) will prompt you.

zh/config/astrbot-config.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ AstrBot 默认配置如下:
138138
"callback_api_base": "",
139139
"default_kb_collection": "", # 默认知识库名称
140140
"plugin_set": ["*"], # "*" 表示使用所有可用的插件, 空列表表示不使用任何插件
141+
"trace_enable": False,
142+
"trace_log_enable": False,
143+
"trace_log_path": "logs/astrbot.trace.log",
144+
"trace_log_max_mb": 20,
141145
}
142146
```
143147

@@ -550,3 +554,19 @@ AstrBot API 的基础地址。用于文件服务和插件回调等功能。如 `
550554
### `plugin_set`
551555

552556
已启用的插件列表。`*` 表示启用所有可用的插件。默认为 `["*"]`
557+
558+
### `trace_enable`
559+
560+
是否启用调用追踪。默认为 `false`。启用后,AstrBot 会记录模型调用路径,可以在 WebUI 的“调用追踪”页面查看。
561+
562+
### `trace_log_enable`
563+
564+
是否将追踪记录保存到文件。默认为 `false`
565+
566+
### `trace_log_path`
567+
568+
追踪日志文件的路径。默认为 `logs/astrbot.trace.log`
569+
570+
### `trace_log_max_mb`
571+
572+
追踪日志文件的最大大小(MB)。默认为 `20`

zh/dev/star/guides/ai.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# AI
32

43
AstrBot 内置了对多种大语言模型(LLM)提供商的支持,并且提供了统一的接口,方便插件开发者调用各种 LLM 服务。
@@ -125,6 +124,19 @@ llm_resp = await self.context.tool_loop_agent(
125124

126125
`tool_loop_agent()` 方法会自动处理工具调用和大模型请求的循环,直到大模型不再调用工具或者达到最大步骤数为止。
127126

127+
## 调用追踪 (Trace)
128+
129+
> [!TIP]
130+
> 在 v4.5.8 时加入
131+
132+
AstrBot 提供了调用追踪(Trace)功能,用于记录模型调用路径。在插件中,你可以通过 `event.trace.record` 记录自定义信息。
133+
134+
```py
135+
event.trace.record("action_name", key1="value1", key2="value2")
136+
```
137+
138+
这些记录可以在 WebUI 的“调用追踪”页面查看。
139+
128140
## Multi-Agent
129141

130142
> [!TIP]
@@ -297,7 +309,7 @@ curr_cid = await conv_mgr.get_curr_conversation_id(uid)
297309
conversation = await conv_mgr.get_conversation(uid, curr_cid) # Conversation
298310
```
299311

300-
::: details Conversation 类型定义
312+
::: details Conversation 类型 definition
301313

302314
```py
303315
@dataclass
@@ -502,7 +514,7 @@ persona_mgr = self.context.persona_manager
502514
- __Returns__
503515
`Personality` – v3 格式的默认人格对象
504516

505-
::: details Persona / Personality 类型定义
517+
::: details Persona / Personality 类型 definition
506518

507519
```py
508520

zh/use/webui.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ AstrBot 管理面板具有管理插件、查看日志、可视化配置、查看
2525

2626
使用右下角第一个圆形按钮可以切换至 `代码编辑配置`。在 `代码编辑配置` 中,你可以直接编辑配置文件。
2727

28-
编辑完后首先点击`应用此配置`,此时配置将应用到可视化配置中,然后再点击右下角`保存`按钮来保存配置。如果你不点击`应用此配置`,那么你的修改将不会生效。
28+
编辑完后首先点击`应用此配置`,此时配置将应用到可视化配置中,然后再点击`保存`按钮来保存配置。如果你不点击`应用此配置`,那么你的修改将不会生效。
2929

3030
![alt text](/source/images/webui/image-5.png)
3131

@@ -49,6 +49,15 @@ AstrBot 管理面板具有管理插件、查看日志、可视化配置、查看
4949

5050
可以对每个指令 启用/禁用、重命名。
5151

52+
## 调用追踪 (Trace)
53+
54+
通过左侧菜单 `调用追踪`,可以查看 AstrBot 的模型调用路径。这对于调试 Agent 的行为非常有用。
55+
56+
在页面右上角,你可以开启或关闭调用追踪记录。开启后,AstrBot 会记录模型调用过程中的关键信息,如工具调用、模型响应等。
57+
58+
> [!NOTE]
59+
> 当前仅记录部分 AstrBot 主 Agent 的模型调用路径,后续会不断完善。
60+
5261
## 更新管理面板
5362

5463
在 AstrBot 启动时,会自动检查管理面板是否需要更新,如果需要,第一条日志(黄色)会进行提示。

0 commit comments

Comments
 (0)