🛰️航天仿真算法库 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
UiToolCallCard
(
const
UiToolCallCard
&) =
delete
;
55
UiToolCallCard
& operator=(
const
UiToolCallCard
&) =
delete
;
56
58
void
setState(
EToolCallState
state);
59
61
void
setResult(
const
QString& result);
62
64
QString
toolCallId
()
const
{
return
toolCallId_; }
65
67
QString
functionName
()
const
{
return
functionName_; }
68
69
private
Q_SLOTS:
70
void
toggleExpanded();
71
72
private
:
73
void
setupUi();
74
void
updateAppearance();
75
76
QString toolCallId_;
77
QString functionName_;
78
QString arguments_;
79
QString result_{};
80
EToolCallState state_{EToolCallState::eRunning};
81
bool
expanded_{
false
};
82
83
QPushButton* headerButton_ =
nullptr
;
// 标题栏按钮
84
QWidget* detailWidget_ =
nullptr
;
// 详情区域
85
QTextEdit* argsView_ =
nullptr
;
// 参数显示
86
QTextEdit* resultView_ =
nullptr
;
// 结果显示
87
QLabel* statusLabel_ =
nullptr
;
// 状态标签
88
};
89
92
AST_NAMESPACE_END
ast::UiToolCallCard
工具调用卡片部件
定义
UiToolCallCard.hpp:39
ast::UiToolCallCard::toolCallId
QString toolCallId() const
获取工具调用 ID
定义
UiToolCallCard.hpp:64
ast::UiToolCallCard::functionName
QString functionName() const
获取函数名称
定义
UiToolCallCard.hpp:67
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