-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctool.h
More file actions
33 lines (30 loc) · 827 Bytes
/
Copy pathfunctool.h
File metadata and controls
33 lines (30 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef FUNCTOOL_H
#define FUNCTOOL_H
#include "chatpro.h"
class FuncTool : public QObject
{
Q_OBJECT
public:
static FuncTool* Get(){
static FuncTool ft;
return &ft;
}
QJsonArray Tools(){
return m_tools;
}
void newTool(const QString &name, const QString &description, const QJsonObject ¶ms);
QString getWeather(const QJsonObject &arguments);
QString getTime(const QJsonObject &arguments = QJsonObject());
QString saveMessages(const QJsonObject &arguments);
QString readMessages();
QString executeFunction(const QString &name, const QJsonObject &arguments);
private:
QJsonArray m_tools;
QJsonObject m_toolTamplate;
QJsonObject m_noneParam;
protected:
FuncTool();
signals:
void loadMessages(QJsonObject);
};
#endif // FUNCTOOL_H