🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
UiToolCallCard.hpp
浏览该文件的文档.
1
12
13
#pragma once
14
15
#include "AstGlobal.h"
16
#include <QWidget>
17
18
class
QLabel;
19
class
QTextEdit;
20
class
QPushButton;
21
22
AST_NAMESPACE_BEGIN
23
30
enum class
EToolCallState
31
{
32
eRunning
,
33
eSuccess
,
34
eError
35
};
36
38
class
AST_UIAI_API
UiToolCallCard
:
public
QWidget
39
{
40
Q_OBJECT
41
42
public
:
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
67
private
Q_SLOTS:
68
void
toggleExpanded();
69
70
private
:
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
90
AST_NAMESPACE_END
ast::UiToolCallCard
工具调用卡片部件
定义
UiToolCallCard.hpp:39
ast::UiToolCallCard::toolCallId
QString toolCallId() const
获取工具调用 ID
定义
UiToolCallCard.hpp:62
ast::UiToolCallCard::functionName
QString functionName() const
获取函数名称
定义
UiToolCallCard.hpp:65
ast::EToolCallState
EToolCallState
工具调用状态
定义
UiToolCallCard.hpp:31
ast::EToolCallState::eSuccess
@ eSuccess
成功
ast::EToolCallState::eError
@ eError
失败
ast::EToolCallState::eRunning
@ eRunning
执行中
src
AstUiAI
Chat
UiToolCallCard.hpp
制作者
1.12.0