🛰️航天仿真算法库 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 PilotSession(const PilotSession&) = delete;
52 PilotSession& operator=(const PilotSession&) = delete;
53
57 std::string execute(const std::string& command);
58
61 void chat(const std::string& message, int maxIterForToolCalls=100);
62
65
67 PilotAgent* agent() const { return agent_; }
68
70 static const char* systemPrompt();
71
73 std::string buildSystemPrompt() const;
74
75private:
77 void registerTools();
78
79 PilotAgent* agent_;
80 ChatSession* chatSession_;
81};
82
85AST_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:67
PilotSession(PilotAgent *agent, QObject *parent=nullptr)
构造函数
std::string buildSystemPrompt() const
构建完整的系统提示词(含应用信息)
std::string execute(const std::string &command)
执行自然语言指令
static const char * systemPrompt()
获取系统提示词