🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
PilotSession.hpp
浏览该文件的文档.
1
19
20#pragma once
21
22#include "AstGlobal.h"
23#include <QObject>
24#include <string>
25
26AST_NAMESPACE_BEGIN
27
28class ChatSession;
29class ChatTools;
30class PilotAgent;
31
39class AST_UIPILOT_API PilotSession : public QObject
40{
41 Q_OBJECT
42
43public:
47 explicit PilotSession(PilotAgent* agent, QObject* parent = nullptr);
48
50 ~PilotSession() override;
51
55 std::string execute(const std::string& command);
56
59 void chat(const std::string& message, int maxIterForToolCalls=100);
60
63
65 PilotAgent* agent() const { return agent_; }
66
68 static const char* systemPrompt();
69
71 std::string buildSystemPrompt() const;
72
73private:
75 void registerTools();
76
77 PilotAgent* agent_;
78 ChatSession* chatSession_;
79};
80
83AST_NAMESPACE_END
聊天会话
定义 ChatSession.hpp:44
Qt控件生命周期管理与界面快照生成
定义 PilotAgent.hpp:46
AstUiPilot 对话会话
定义 PilotSession.hpp:40
void chat(const std::string &message, int maxIterForToolCalls=100)
发送消息
~PilotSession() override
析构函数
ChatSession & session()
获取 ChatSession(用于高级配置)
PilotAgent * agent() const
获取 PilotAgent
定义 PilotSession.hpp:65
PilotSession(PilotAgent *agent, QObject *parent=nullptr)
构造函数
std::string buildSystemPrompt() const
构建完整的系统提示词(含应用信息)
std::string execute(const std::string &command)
执行自然语言指令
static const char * systemPrompt()
获取系统提示词