27 lines
606 B
C++
27 lines
606 B
C++
#pragma once
|
|
#include <QJsonObject>
|
|
#include <QString>
|
|
#include <QVariantMap>
|
|
|
|
/** HarmonyAdapter: translate native tool specs/calls to/from OpenAI Harmony JSON */
|
|
namespace Harmony {
|
|
|
|
struct ToolSpec {
|
|
QString name;
|
|
QString description;
|
|
QJsonObject parameters; // JSON Schema-like
|
|
};
|
|
|
|
struct ToolCall {
|
|
QString name;
|
|
QVariantMap arguments;
|
|
};
|
|
|
|
QJsonObject toHarmony(const ToolSpec &spec);
|
|
ToolSpec fromHarmonySpec(const QJsonObject &obj, bool *ok=nullptr);
|
|
|
|
QJsonObject toHarmony(const ToolCall &call);
|
|
ToolCall fromHarmonyCall(const QJsonObject &obj, bool *ok=nullptr);
|
|
|
|
} // namespace Harmony
|