metal-kompanion/src/KI/Tool/KITool.h

76 lines
1.6 KiB
C++

#ifndef KIANITOOL_H
#define KIANITOOL_H
#include <QObject>
#include <QString>
#include <QList>
#include <QVariant>
#include <QVariantMap>
namespace KI {
class KIToolParam
{
Q_GADGET
Q_PROPERTY(QString name MEMBER name)
Q_PROPERTY(QString type MEMBER type)
Q_PROPERTY(bool required MEMBER required)
Q_PROPERTY(QVariant defaultValue MEMBER defaultValue)
public:
QString name, type;
bool required = false;
QVariant defaultValue;
bool operator==(const KIToolParam& other) const = default;
bool operator!=(const KIToolParam& other) const = default;
};
class KIToolSpec
{
Q_GADGET
Q_PROPERTY(QString name MEMBER name)
Q_PROPERTY(QString description MEMBER description)
Q_PROPERTY(QList<KIToolParam> params MEMBER params)
public:
QString name, description;
QList<KIToolParam> params;
bool operator==(const KIToolSpec& other) const = default;
bool operator!=(const KIToolSpec& other) const = default;
};
class KIToolCall
{
Q_GADGET
Q_PROPERTY(QString name MEMBER name)
Q_PROPERTY(QVariantMap arguments MEMBER arguments)
public:
QString name;
QVariantMap arguments;
bool operator==(const KIToolCall& other) const = default;
bool operator!=(const KIToolCall& other) const = default;
};
class KIToolResult
{
Q_GADGET
Q_PROPERTY(QString name MEMBER name)
Q_PROPERTY(QVariant result MEMBER result)
public:
QString name;
QVariant result;
bool operator==(const KIToolResult& other) const = default;
bool operator!=(const KIToolResult& other) const = default;
};
} // namespace KI
#endif // KIANITOOL_H