23#include "AstHarness/LLMClient.hpp"
24#include "AstHarness/ChatAgent.hpp"
25#include "AstHarness/LLMConfig.hpp"
26#include "AstHarness/ChatTool.hpp"
27#include "AstHarness/ChatMessages.hpp"
28#include "AstHarness/ChatTools.hpp"
29#include "AstHarness/AssistantAgent.hpp"
55 std::string chat(
StringView message,
int maxIterForToolCalls = 100);
81 void setAgent(std::unique_ptr<AssistantAgent> agent){agent_ = std::move(agent);}
91 const std::string&
lastError()
const {
return agent().lastError();}
100 errc_t makeChatCompletion();
104 void handleToolCalls(
const JsonValue& toolCalls);
107 mutable std::unique_ptr<AssistantAgent> agent_{};
108 ChatMessages messages_{};
聊天智能体
定义 AssistantAgent.hpp:47
流式聊天事件处理器
定义 ChatEventHandler.hpp:42
聊天消息集合
定义 ChatMessages.hpp:39
聊天会话
定义 ChatSession.hpp:44
ChatTools & tools()
获取工具集合
定义 ChatSession.hpp:85
const LLMConfig & config() const
获取LLM配置(只读)
定义 ChatSession.hpp:96
LLMConfig & config()
获取LLM配置
定义 ChatSession.hpp:94
void setAgent(std::unique_ptr< AssistantAgent > agent)
设置聊天智能体(转移所有权)
定义 ChatSession.hpp:81
const std::string & lastError() const
获取最后一次错误信息
定义 ChatSession.hpp:91
LLMClient & client()
获取当前使用的AI接口
定义 ChatSession.hpp:88
ChatMessages & messages()
获取消息历史
定义 ChatSession.hpp:74
JSON 值类
定义 JsonValue.hpp:47
大语言模型客户端接口
定义 LLMClient.hpp:39
LLM请求配置
定义 LLMConfig.hpp:39