72 const std::string& functionName,
73 const std::string& arguments) {}
80 const std::string& functionName,
81 const std::string& result) {}
90 virtual void onError(
const std::string& error) {}
流式聊天事件处理器
定义 ChatEventHandler.hpp:42
virtual bool isCancelled() const
检查是否被取消
定义 ChatEventHandler.hpp:94
virtual void onComplete()
本轮对话完成
定义 ChatEventHandler.hpp:86
virtual void onToolCallRequest(const std::string &toolCallId, const std::string &functionName, const std::string &arguments)
LLM 请求调用工具(含完整函数名和参数)
定义 ChatEventHandler.hpp:71
virtual void onReasoningComplete(const std::string &reasoning)
收到完整推理内容
定义 ChatEventHandler.hpp:62
virtual void onReasoningChunk(const std::string &reasoning)
收到一块推理内容(delta)
定义 ChatEventHandler.hpp:58
virtual void onContentChunk(const std::string &text)
收到一块文本内容(delta)
定义 ChatEventHandler.hpp:51
virtual void onError(const std::string &error)
发生错误
定义 ChatEventHandler.hpp:90
virtual void onContentComplete(const std::string &text)
收到完整文本内容
定义 ChatEventHandler.hpp:54
virtual void onToolCallResult(const std::string &toolCallId, const std::string &functionName, const std::string &result)
工具执行完毕,返回结果
定义 ChatEventHandler.hpp:79