fix: Add checking model support for tool calling (#350)

This commit is contained in:
Petr Mironychev
2026-05-17 21:27:18 +02:00
committed by GitHub
parent 6addcedfd0
commit 74c899c8c3
16 changed files with 334 additions and 18 deletions

View File

@@ -6,6 +6,7 @@
#include <QJsonArray>
#include "pluginllmcore/PromptTemplate.hpp"
#include "templates/ToolMessages.hpp"
namespace QodeAssist::Templates {
@@ -15,6 +16,7 @@ public:
PluginLLMCore::TemplateType type() const override { return PluginLLMCore::TemplateType::Chat; }
QString name() const override { return "OpenAI"; }
QStringList stopWords() const override { return QStringList(); }
bool supportsToolHistory() const override { return true; }
void prepareRequest(QJsonObject &request, const PluginLLMCore::ContextData &context) const override
{
QJsonArray messages;
@@ -26,6 +28,9 @@ public:
if (context.history) {
for (const auto &msg : context.history.value()) {
if (appendOpenAIToolMessage(messages, msg)) {
continue;
}
if (msg.images && !msg.images->isEmpty()) {
QJsonArray content;