#include <UserProxyAgent.hpp>
用户代理智能体
从终端读取用户输入,支持退出关键词检测。 当用户输入匹配退出关键词时,向消息历史中添加 "EXIT", 配合 TextMentionTermination 可实现优雅退出。
◆ addExitKeyword()
| void ast::UserProxyAgent::addExitKeyword |
( |
StringView | keyword | ) |
|
|
inline |
◆ run()
◆ runStream()
执行智能体逻辑(流式)
- 参数
-
| messages | 消息历史(可修改) |
| handler | 事件处理器(实时接收 delta 事件) |
- 返回
- 错误码,0表示成功
实现了 ast::ChatAgent.
◆ setExitKeywords()
| void ast::UserProxyAgent::setExitKeywords |
( |
const std::vector< std::string > & | keywords | ) |
|
|
inline |
设置退出关键词列表(完全替换现有列表)
- 参数
-
| keywords | 退出关键词列表(如 {"quit", "exit", "q"}) |
该类的文档由以下文件生成: