🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
UiToolCallCard.hpp
浏览该文件的文档.
1
12
13#pragma once
14
15#include "AstGlobal.h"
16#include <QWidget>
17
18class QLabel;
19class QTextEdit;
20class QPushButton;
21
22AST_NAMESPACE_BEGIN
23
31{
32 eRunning,
33 eSuccess,
34 eError
35};
36
38class AST_UIAI_API UiToolCallCard : public QWidget
39{
40 Q_OBJECT
41
42public:
48 explicit UiToolCallCard(const QString& toolCallId,
49 const QString& functionName,
50 const QString& arguments = QString(),
51 QWidget* parent = nullptr);
52
53 ~UiToolCallCard() override;
54
56 void setState(EToolCallState state);
57
59 void setResult(const QString& result);
60
62 QString toolCallId() const { return toolCallId_; }
63
65 QString functionName() const { return functionName_; }
66
67private Q_SLOTS:
68 void toggleExpanded();
69
70private:
71 void setupUi();
72 void updateAppearance();
73
74 QString toolCallId_;
75 QString functionName_;
76 QString arguments_;
77 QString result_;
78 EToolCallState state_{EToolCallState::eRunning};
79 bool expanded_{false};
80
81 QPushButton* headerButton_ = nullptr; // 标题栏按钮
82 QWidget* detailWidget_ = nullptr; // 详情区域
83 QTextEdit* argsView_ = nullptr; // 参数显示
84 QTextEdit* resultView_ = nullptr; // 结果显示
85 QLabel* statusLabel_ = nullptr; // 状态标签
86};
87
90AST_NAMESPACE_END
工具调用卡片部件
定义 UiToolCallCard.hpp:39
QString toolCallId() const
获取工具调用 ID
定义 UiToolCallCard.hpp:62
QString functionName() const
获取函数名称
定义 UiToolCallCard.hpp:65
EToolCallState
工具调用状态
定义 UiToolCallCard.hpp:31