mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
fix: Add checking model support for tool calling (#350)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
@@ -17,6 +18,15 @@ struct ImageAttachment
|
||||
bool operator==(const ImageAttachment &) const = default;
|
||||
};
|
||||
|
||||
struct ToolCall
|
||||
{
|
||||
QString id;
|
||||
QString name;
|
||||
QJsonObject arguments;
|
||||
|
||||
bool operator==(const ToolCall &) const = default;
|
||||
};
|
||||
|
||||
struct Message
|
||||
{
|
||||
QString role;
|
||||
@@ -26,6 +36,10 @@ struct Message
|
||||
bool isRedacted = false;
|
||||
std::optional<QVector<ImageAttachment>> images;
|
||||
|
||||
QVector<ToolCall> toolCalls;
|
||||
QString toolCallId;
|
||||
QString toolName;
|
||||
|
||||
// clang-format off
|
||||
bool operator==(const Message&) const = default;
|
||||
// clang-format on
|
||||
|
||||
@@ -25,12 +25,8 @@ public:
|
||||
virtual QString description() const = 0;
|
||||
virtual bool isSupportProvider(ProviderID id) const = 0;
|
||||
|
||||
// Endpoint path this template expects to be sent to. Empty string
|
||||
// (default) means "let the provider's client use its standard chat
|
||||
// path" (/chat/completions, /api/chat, /v1/messages, ...). Templates
|
||||
// producing non-chat payload shapes (e.g. {prompt, suffix} for
|
||||
// Mistral FIM, {input_prefix, input_suffix} for llama.cpp infill)
|
||||
// must override this to the path their payload is valid for.
|
||||
virtual QString endpoint() const { return {}; }
|
||||
|
||||
virtual bool supportsToolHistory() const { return false; }
|
||||
};
|
||||
} // namespace QodeAssist::PluginLLMCore
|
||||
|
||||
Reference in New Issue
Block a user