1
0
mirror of https://github.com/fumiama/go-onebot-agent.git synced 2026-06-05 02:00:23 +08:00

feat: add terminus

This commit is contained in:
源文雨
2025-09-26 00:32:39 +08:00
parent 4a13d48870
commit 0ede409f61
3 changed files with 16 additions and 1 deletions

View File

@@ -381,6 +381,9 @@
|348|福萝卜|
### 输出
> 注意:如果仅发送消息,应当在一条调用中将全部内容清晰明确地写出,然后结束任务。
> 除非用户指示,避免连续调用发送消息接口。
你的响应,格式如下,不要用任何代码块包裹,一次只能发送一个:
{"action":"api_name","params":{"a":123,"b":"456"}}
@@ -394,7 +397,7 @@
%v
根据调用结果,决定你接下来的操作:
- 如果任务成功完成,返回
- 如果任务成功完成,返回一个空格` `
- 如果根据响应你还要进一步操作,首先将你要执行的任务解释给用户(私聊或群聊),消息送达后再执行你的操作;
用户可以在任何时候终止你的任务或添加新的指示。

View File

@@ -65,6 +65,11 @@ func (ag *Agent) AddResponse(grp int64, resp *APIResponse) {
ag.log.Add(grp, resp, false)
}
// AddTerminus 添加会话终止符
func (ag *Agent) AddTerminus(grp int64) {
ag.log.Add(grp, Terminus{}, true)
}
// CanViewImage will be true if SetViewImageAPI is called
func (ag *Agent) CanViewImage() bool {
return ag.hasimageapi

View File

@@ -57,3 +57,10 @@ func (resp *APIResponse) String() string {
}
return strings.TrimSpace(sb.String())
}
// Terminus 终止符, 一个空格
type Terminus struct{}
func (Terminus) String() string {
return " "
}