25#include "AstAI/ChatAgent.hpp"
26#include "AstAI/ChatMessages.hpp"
27#include "AstAI/TerminationCondition.hpp"
37class TerminationCondition;
53 const std::vector<ChatAgent*>&
agents()
const {
return agents_; }
58 void setTerminationCondition(std::unique_ptr<TerminationCondition> condition);
84 std::vector<ChatAgent*> agents_;
86 std::unique_ptr<TerminationCondition> terminationCondition_;
virtual errc_t run(const ChatMessage &message, ChatMessage &response)=0
运行一次聊天,返回最终的响应消息,过程中会处理工具调用、多个Agent交互等逻辑
聊天智能体抽象基类
定义 ChatAgent.hpp:40
聊天消息
定义 ChatMessage.hpp:52
聊天消息集合
定义 ChatMessages.hpp:39
轮询式群聊
定义 RoundRobinGroupChat.hpp:42
void setMaxRounds(int maxRounds)
设置最大轮次数(默认100,防止无限循环)
定义 RoundRobinGroupChat.hpp:74
const std::vector< ChatAgent * > & agents() const
获取所有Agent
定义 RoundRobinGroupChat.hpp:53
int maxRounds() const
获取最大轮次数
定义 RoundRobinGroupChat.hpp:77
const ChatMessages & messages() const
获取消息历史(只读)
定义 RoundRobinGroupChat.hpp:69
TerminationCondition * terminationCondition() const
获取终止条件
定义 RoundRobinGroupChat.hpp:61
ChatMessages & messages()
获取消息历史(可修改)
定义 RoundRobinGroupChat.hpp:66
终止条件
定义 TerminationCondition.hpp:37