mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
Update LLMQore to v0.0.4 (#339)
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
|
||||
#include <LLMCore/ToolsManager.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
|
||||
#include "logger/Logger.hpp"
|
||||
#include "settings/ChatAssistantSettings.hpp"
|
||||
@@ -37,7 +37,7 @@ namespace QodeAssist::Providers {
|
||||
|
||||
ClaudeProvider::ClaudeProvider(QObject *parent)
|
||||
: PluginLLMCore::Provider(parent)
|
||||
, m_client(new ::LLMCore::ClaudeClient(QString(), QString(), QString(), this))
|
||||
, m_client(new ::LLMQore::ClaudeClient(QString(), QString(), QString(), this))
|
||||
{
|
||||
Tools::registerQodeAssistTools(m_client->tools());
|
||||
}
|
||||
@@ -57,16 +57,6 @@ QString ClaudeProvider::url() const
|
||||
return "https://api.anthropic.com";
|
||||
}
|
||||
|
||||
QString ClaudeProvider::completionEndpoint() const
|
||||
{
|
||||
return "/v1/messages";
|
||||
}
|
||||
|
||||
QString ClaudeProvider::chatEndpoint() const
|
||||
{
|
||||
return "/v1/messages";
|
||||
}
|
||||
|
||||
void ClaudeProvider::prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -151,7 +141,7 @@ PluginLLMCore::ProviderCapabilities ClaudeProvider::capabilities() const
|
||||
| PluginLLMCore::ProviderCapability::ModelListing;
|
||||
}
|
||||
|
||||
::LLMCore::BaseClient *ClaudeProvider::client() const
|
||||
::LLMQore::BaseClient *ClaudeProvider::client() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <pluginllmcore/Provider.hpp>
|
||||
|
||||
#include <LLMCore/ClaudeClient.hpp>
|
||||
#include <LLMQore/ClaudeClient.hpp>
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
|
||||
@@ -33,8 +33,6 @@ public:
|
||||
|
||||
QString name() const override;
|
||||
QString url() const override;
|
||||
QString completionEndpoint() const override;
|
||||
QString chatEndpoint() const override;
|
||||
void prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -46,11 +44,11 @@ public:
|
||||
PluginLLMCore::ProviderID providerID() const override;
|
||||
PluginLLMCore::ProviderCapabilities capabilities() const override;
|
||||
|
||||
::LLMCore::BaseClient *client() const override;
|
||||
::LLMQore::BaseClient *client() const override;
|
||||
QString apiKey() const override;
|
||||
|
||||
private:
|
||||
::LLMCore::ClaudeClient *m_client;
|
||||
::LLMQore::ClaudeClient *m_client;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Providers
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "GoogleAIProvider.hpp"
|
||||
|
||||
#include <LLMCore/ToolsManager.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
|
||||
#include <QJsonArray>
|
||||
#include "tools/ToolsRegistration.hpp"
|
||||
@@ -38,7 +38,7 @@ namespace QodeAssist::Providers {
|
||||
|
||||
GoogleAIProvider::GoogleAIProvider(QObject *parent)
|
||||
: PluginLLMCore::Provider(parent)
|
||||
, m_client(new ::LLMCore::GoogleAIClient(QString(), QString(), QString(), this))
|
||||
, m_client(new ::LLMQore::GoogleAIClient(QString(), QString(), QString(), this))
|
||||
{
|
||||
Tools::registerQodeAssistTools(m_client->tools());
|
||||
}
|
||||
@@ -58,16 +58,6 @@ QString GoogleAIProvider::url() const
|
||||
return "https://generativelanguage.googleapis.com/v1beta";
|
||||
}
|
||||
|
||||
QString GoogleAIProvider::completionEndpoint() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
QString GoogleAIProvider::chatEndpoint() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
void GoogleAIProvider::prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -165,7 +155,25 @@ PluginLLMCore::ProviderCapabilities GoogleAIProvider::capabilities() const
|
||||
| PluginLLMCore::ProviderCapability::ModelListing;
|
||||
}
|
||||
|
||||
::LLMCore::BaseClient *GoogleAIProvider::client() const
|
||||
PluginLLMCore::RequestID GoogleAIProvider::sendRequest(
|
||||
const QUrl &url, const QJsonObject &payload, const QString &endpoint)
|
||||
{
|
||||
// Gemini takes the model from the URL path and streaming from the
|
||||
// action suffix (:streamGenerateContent vs :generateContent), and
|
||||
// rejects unknown top-level body fields. The shared call-site seeds
|
||||
// payload with {model, stream}; consume them here into client state
|
||||
// before they hit the wire.
|
||||
QJsonObject cleaned = payload;
|
||||
if (cleaned.contains("model")) {
|
||||
m_client->setModel(cleaned["model"].toString());
|
||||
cleaned.remove("model");
|
||||
}
|
||||
cleaned.remove("stream");
|
||||
|
||||
return PluginLLMCore::Provider::sendRequest(url, cleaned, endpoint);
|
||||
}
|
||||
|
||||
::LLMQore::BaseClient *GoogleAIProvider::client() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <pluginllmcore/Provider.hpp>
|
||||
|
||||
#include <LLMCore/GoogleAIClient.hpp>
|
||||
#include <LLMQore/GoogleAIClient.hpp>
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
|
||||
@@ -33,8 +33,6 @@ public:
|
||||
|
||||
QString name() const override;
|
||||
QString url() const override;
|
||||
QString completionEndpoint() const override;
|
||||
QString chatEndpoint() const override;
|
||||
void prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -46,11 +44,14 @@ public:
|
||||
PluginLLMCore::ProviderID providerID() const override;
|
||||
PluginLLMCore::ProviderCapabilities capabilities() const override;
|
||||
|
||||
::LLMCore::BaseClient *client() const override;
|
||||
PluginLLMCore::RequestID sendRequest(
|
||||
const QUrl &url, const QJsonObject &payload, const QString &endpoint) override;
|
||||
|
||||
::LLMQore::BaseClient *client() const override;
|
||||
QString apiKey() const override;
|
||||
|
||||
private:
|
||||
::LLMCore::GoogleAIClient *m_client;
|
||||
::LLMQore::GoogleAIClient *m_client;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Providers
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "LMStudioProvider.hpp"
|
||||
|
||||
#include <LLMCore/ToolsManager.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
|
||||
#include "tools/ToolsRegistration.hpp"
|
||||
#include "logger/Logger.hpp"
|
||||
@@ -37,7 +37,7 @@ namespace QodeAssist::Providers {
|
||||
|
||||
LMStudioProvider::LMStudioProvider(QObject *parent)
|
||||
: PluginLLMCore::Provider(parent)
|
||||
, m_client(new ::LLMCore::OpenAIClient(QString(), QString(), QString(), this))
|
||||
, m_client(new ::LLMQore::OpenAIClient(QString(), QString(), QString(), this))
|
||||
{
|
||||
Tools::registerQodeAssistTools(m_client->tools());
|
||||
}
|
||||
@@ -54,17 +54,7 @@ QString LMStudioProvider::apiKey() const
|
||||
|
||||
QString LMStudioProvider::url() const
|
||||
{
|
||||
return "http://localhost:1234";
|
||||
}
|
||||
|
||||
QString LMStudioProvider::completionEndpoint() const
|
||||
{
|
||||
return "/v1/completions";
|
||||
}
|
||||
|
||||
QString LMStudioProvider::chatEndpoint() const
|
||||
{
|
||||
return "/v1/chat/completions";
|
||||
return "http://localhost:1234/v1";
|
||||
}
|
||||
|
||||
QFuture<QList<QString>> LMStudioProvider::getInstalledModels(const QString &url)
|
||||
@@ -130,7 +120,7 @@ void LMStudioProvider::prepareRequest(
|
||||
}
|
||||
}
|
||||
|
||||
::LLMCore::BaseClient *LMStudioProvider::client() const
|
||||
::LLMQore::BaseClient *LMStudioProvider::client() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LLMCore/OpenAIClient.hpp>
|
||||
#include <LLMQore/OpenAIClient.hpp>
|
||||
#include <pluginllmcore/Provider.hpp>
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
@@ -32,8 +32,6 @@ public:
|
||||
|
||||
QString name() const override;
|
||||
QString url() const override;
|
||||
QString completionEndpoint() const override;
|
||||
QString chatEndpoint() const override;
|
||||
void prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -45,11 +43,11 @@ public:
|
||||
PluginLLMCore::ProviderID providerID() const override;
|
||||
PluginLLMCore::ProviderCapabilities capabilities() const override;
|
||||
|
||||
::LLMCore::BaseClient *client() const override;
|
||||
::LLMQore::BaseClient *client() const override;
|
||||
QString apiKey() const override;
|
||||
|
||||
private:
|
||||
::LLMCore::OpenAIClient *m_client;
|
||||
::LLMQore::OpenAIClient *m_client;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Providers
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "LlamaCppProvider.hpp"
|
||||
|
||||
#include <LLMCore/ToolsManager.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
#include "logger/Logger.hpp"
|
||||
#include "settings/ChatAssistantSettings.hpp"
|
||||
#include "settings/CodeCompletionSettings.hpp"
|
||||
@@ -35,7 +35,7 @@ namespace QodeAssist::Providers {
|
||||
|
||||
LlamaCppProvider::LlamaCppProvider(QObject *parent)
|
||||
: PluginLLMCore::Provider(parent)
|
||||
, m_client(new ::LLMCore::LlamaCppClient(QString(), QString(), QString(), this))
|
||||
, m_client(new ::LLMQore::LlamaCppClient(QString(), QString(), QString(), this))
|
||||
{
|
||||
Tools::registerQodeAssistTools(m_client->tools());
|
||||
}
|
||||
@@ -55,16 +55,6 @@ QString LlamaCppProvider::url() const
|
||||
return "http://localhost:8080";
|
||||
}
|
||||
|
||||
QString LlamaCppProvider::completionEndpoint() const
|
||||
{
|
||||
return "/infill";
|
||||
}
|
||||
|
||||
QString LlamaCppProvider::chatEndpoint() const
|
||||
{
|
||||
return "/v1/chat/completions";
|
||||
}
|
||||
|
||||
void LlamaCppProvider::prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -125,7 +115,7 @@ PluginLLMCore::ProviderCapabilities LlamaCppProvider::capabilities() const
|
||||
return PluginLLMCore::ProviderCapability::Tools | PluginLLMCore::ProviderCapability::Image;
|
||||
}
|
||||
|
||||
::LLMCore::BaseClient *LlamaCppProvider::client() const
|
||||
::LLMQore::BaseClient *LlamaCppProvider::client() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <pluginllmcore/Provider.hpp>
|
||||
|
||||
#include <LLMCore/LlamaCppClient.hpp>
|
||||
#include <LLMQore/LlamaCppClient.hpp>
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
|
||||
@@ -33,8 +33,6 @@ public:
|
||||
|
||||
QString name() const override;
|
||||
QString url() const override;
|
||||
QString completionEndpoint() const override;
|
||||
QString chatEndpoint() const override;
|
||||
void prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -46,11 +44,11 @@ public:
|
||||
PluginLLMCore::ProviderID providerID() const override;
|
||||
PluginLLMCore::ProviderCapabilities capabilities() const override;
|
||||
|
||||
::LLMCore::BaseClient *client() const override;
|
||||
::LLMQore::BaseClient *client() const override;
|
||||
QString apiKey() const override;
|
||||
|
||||
private:
|
||||
::LLMCore::LlamaCppClient *m_client;
|
||||
::LLMQore::LlamaCppClient *m_client;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Providers
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "MistralAIProvider.hpp"
|
||||
|
||||
#include <LLMCore/ToolsManager.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
#include "logger/Logger.hpp"
|
||||
#include "settings/ChatAssistantSettings.hpp"
|
||||
#include "settings/CodeCompletionSettings.hpp"
|
||||
@@ -36,7 +36,7 @@ namespace QodeAssist::Providers {
|
||||
|
||||
MistralAIProvider::MistralAIProvider(QObject *parent)
|
||||
: PluginLLMCore::Provider(parent)
|
||||
, m_client(new ::LLMCore::OpenAIClient(QString(), QString(), QString(), this))
|
||||
, m_client(new ::LLMQore::MistralClient(QString(), QString(), QString(), this))
|
||||
{
|
||||
Tools::registerQodeAssistTools(m_client->tools());
|
||||
}
|
||||
@@ -56,16 +56,6 @@ QString MistralAIProvider::url() const
|
||||
return "https://api.mistral.ai";
|
||||
}
|
||||
|
||||
QString MistralAIProvider::completionEndpoint() const
|
||||
{
|
||||
return "/v1/fim/completions";
|
||||
}
|
||||
|
||||
QString MistralAIProvider::chatEndpoint() const
|
||||
{
|
||||
return "/v1/chat/completions";
|
||||
}
|
||||
|
||||
QFuture<QList<QString>> MistralAIProvider::getInstalledModels(const QString &url)
|
||||
{
|
||||
m_client->setUrl(url);
|
||||
@@ -129,7 +119,7 @@ void MistralAIProvider::prepareRequest(
|
||||
}
|
||||
}
|
||||
|
||||
::LLMCore::BaseClient *MistralAIProvider::client() const
|
||||
::LLMQore::BaseClient *MistralAIProvider::client() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LLMCore/OpenAIClient.hpp>
|
||||
#include <LLMQore/MistralClient.hpp>
|
||||
#include <pluginllmcore/Provider.hpp>
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
@@ -32,8 +32,6 @@ public:
|
||||
|
||||
QString name() const override;
|
||||
QString url() const override;
|
||||
QString completionEndpoint() const override;
|
||||
QString chatEndpoint() const override;
|
||||
void prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -45,11 +43,11 @@ public:
|
||||
PluginLLMCore::ProviderID providerID() const override;
|
||||
PluginLLMCore::ProviderCapabilities capabilities() const override;
|
||||
|
||||
::LLMCore::BaseClient *client() const override;
|
||||
::LLMQore::BaseClient *client() const override;
|
||||
QString apiKey() const override;
|
||||
|
||||
private:
|
||||
::LLMCore::OpenAIClient *m_client;
|
||||
::LLMQore::MistralClient *m_client;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Providers
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "OllamaProvider.hpp"
|
||||
|
||||
#include <LLMCore/ToolsManager.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
@@ -37,7 +37,7 @@ namespace QodeAssist::Providers {
|
||||
|
||||
OllamaProvider::OllamaProvider(QObject *parent)
|
||||
: PluginLLMCore::Provider(parent)
|
||||
, m_client(new ::LLMCore::OllamaClient(QString(), QString(), QString(), this))
|
||||
, m_client(new ::LLMQore::OllamaClient(QString(), QString(), QString(), this))
|
||||
{
|
||||
Tools::registerQodeAssistTools(m_client->tools());
|
||||
}
|
||||
@@ -57,16 +57,6 @@ QString OllamaProvider::url() const
|
||||
return "http://localhost:11434";
|
||||
}
|
||||
|
||||
QString OllamaProvider::completionEndpoint() const
|
||||
{
|
||||
return "/api/generate";
|
||||
}
|
||||
|
||||
QString OllamaProvider::chatEndpoint() const
|
||||
{
|
||||
return "/api/chat";
|
||||
}
|
||||
|
||||
void OllamaProvider::prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -156,7 +146,7 @@ PluginLLMCore::ProviderCapabilities OllamaProvider::capabilities() const
|
||||
| PluginLLMCore::ProviderCapability::ModelListing;
|
||||
}
|
||||
|
||||
::LLMCore::BaseClient *OllamaProvider::client() const
|
||||
::LLMQore::BaseClient *OllamaProvider::client() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <pluginllmcore/Provider.hpp>
|
||||
|
||||
#include <LLMCore/OllamaClient.hpp>
|
||||
#include <LLMQore/OllamaClient.hpp>
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
|
||||
@@ -33,8 +33,6 @@ public:
|
||||
|
||||
QString name() const override;
|
||||
QString url() const override;
|
||||
QString completionEndpoint() const override;
|
||||
QString chatEndpoint() const override;
|
||||
void prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -46,11 +44,11 @@ public:
|
||||
PluginLLMCore::ProviderID providerID() const override;
|
||||
PluginLLMCore::ProviderCapabilities capabilities() const override;
|
||||
|
||||
::LLMCore::BaseClient *client() const override;
|
||||
::LLMQore::BaseClient *client() const override;
|
||||
QString apiKey() const override;
|
||||
|
||||
private:
|
||||
::LLMCore::OllamaClient *m_client;
|
||||
::LLMQore::OllamaClient *m_client;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Providers
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "OpenAICompatProvider.hpp"
|
||||
#include <LLMCore/ToolsManager.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
|
||||
#include "tools/ToolsRegistration.hpp"
|
||||
#include "logger/Logger.hpp"
|
||||
@@ -36,7 +36,7 @@ namespace QodeAssist::Providers {
|
||||
|
||||
OpenAICompatProvider::OpenAICompatProvider(QObject *parent)
|
||||
: PluginLLMCore::Provider(parent)
|
||||
, m_client(new ::LLMCore::OpenAIClient(QString(), QString(), QString(), this))
|
||||
, m_client(new ::LLMQore::OpenAIClient(QString(), QString(), QString(), this))
|
||||
{
|
||||
Tools::registerQodeAssistTools(m_client->tools());
|
||||
}
|
||||
@@ -53,17 +53,7 @@ QString OpenAICompatProvider::apiKey() const
|
||||
|
||||
QString OpenAICompatProvider::url() const
|
||||
{
|
||||
return "http://localhost:1234";
|
||||
}
|
||||
|
||||
QString OpenAICompatProvider::completionEndpoint() const
|
||||
{
|
||||
return "/v1/chat/completions";
|
||||
}
|
||||
|
||||
QString OpenAICompatProvider::chatEndpoint() const
|
||||
{
|
||||
return "/v1/chat/completions";
|
||||
return "http://localhost:1234/v1";
|
||||
}
|
||||
|
||||
void OpenAICompatProvider::prepareRequest(
|
||||
@@ -127,7 +117,7 @@ PluginLLMCore::ProviderCapabilities OpenAICompatProvider::capabilities() const
|
||||
return PluginLLMCore::ProviderCapability::Tools | PluginLLMCore::ProviderCapability::Image;
|
||||
}
|
||||
|
||||
::LLMCore::BaseClient *OpenAICompatProvider::client() const
|
||||
::LLMQore::BaseClient *OpenAICompatProvider::client() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LLMCore/OpenAIClient.hpp>
|
||||
#include <LLMQore/OpenAIClient.hpp>
|
||||
#include <pluginllmcore/Provider.hpp>
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
@@ -32,8 +32,6 @@ public:
|
||||
|
||||
QString name() const override;
|
||||
QString url() const override;
|
||||
QString completionEndpoint() const override;
|
||||
QString chatEndpoint() const override;
|
||||
void prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -45,11 +43,11 @@ public:
|
||||
PluginLLMCore::ProviderID providerID() const override;
|
||||
PluginLLMCore::ProviderCapabilities capabilities() const override;
|
||||
|
||||
::LLMCore::BaseClient *client() const override;
|
||||
::LLMQore::BaseClient *client() const override;
|
||||
QString apiKey() const override;
|
||||
|
||||
private:
|
||||
::LLMCore::OpenAIClient *m_client;
|
||||
::LLMQore::OpenAIClient *m_client;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Providers
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "OpenAIProvider.hpp"
|
||||
|
||||
#include <LLMCore/ToolsManager.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
#include "tools/ToolsRegistration.hpp"
|
||||
#include "logger/Logger.hpp"
|
||||
#include "settings/ChatAssistantSettings.hpp"
|
||||
@@ -36,7 +36,7 @@ namespace QodeAssist::Providers {
|
||||
|
||||
OpenAIProvider::OpenAIProvider(QObject *parent)
|
||||
: PluginLLMCore::Provider(parent)
|
||||
, m_client(new ::LLMCore::OpenAIClient(QString(), QString(), QString(), this))
|
||||
, m_client(new ::LLMQore::OpenAIClient(QString(), QString(), QString(), this))
|
||||
{
|
||||
Tools::registerQodeAssistTools(m_client->tools());
|
||||
}
|
||||
@@ -53,17 +53,7 @@ QString OpenAIProvider::apiKey() const
|
||||
|
||||
QString OpenAIProvider::url() const
|
||||
{
|
||||
return "https://api.openai.com";
|
||||
}
|
||||
|
||||
QString OpenAIProvider::completionEndpoint() const
|
||||
{
|
||||
return "/v1/chat/completions";
|
||||
}
|
||||
|
||||
QString OpenAIProvider::chatEndpoint() const
|
||||
{
|
||||
return "/v1/chat/completions";
|
||||
return "https://api.openai.com/v1";
|
||||
}
|
||||
|
||||
void OpenAIProvider::prepareRequest(
|
||||
@@ -158,7 +148,7 @@ PluginLLMCore::ProviderCapabilities OpenAIProvider::capabilities() const
|
||||
| PluginLLMCore::ProviderCapability::ModelListing;
|
||||
}
|
||||
|
||||
::LLMCore::BaseClient *OpenAIProvider::client() const
|
||||
::LLMQore::BaseClient *OpenAIProvider::client() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LLMCore/OpenAIClient.hpp>
|
||||
#include <LLMQore/OpenAIClient.hpp>
|
||||
#include <pluginllmcore/Provider.hpp>
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
@@ -32,8 +32,6 @@ public:
|
||||
|
||||
QString name() const override;
|
||||
QString url() const override;
|
||||
QString completionEndpoint() const override;
|
||||
QString chatEndpoint() const override;
|
||||
void prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -45,11 +43,11 @@ public:
|
||||
PluginLLMCore::ProviderID providerID() const override;
|
||||
PluginLLMCore::ProviderCapabilities capabilities() const override;
|
||||
|
||||
::LLMCore::BaseClient *client() const override;
|
||||
::LLMQore::BaseClient *client() const override;
|
||||
QString apiKey() const override;
|
||||
|
||||
private:
|
||||
::LLMCore::OpenAIClient *m_client;
|
||||
::LLMQore::OpenAIClient *m_client;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Providers
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "OpenAIResponsesProvider.hpp"
|
||||
#include <LLMCore/ToolsManager.hpp>
|
||||
#include <LLMQore/ToolsManager.hpp>
|
||||
#include "tools/ToolsRegistration.hpp"
|
||||
|
||||
#include "logger/Logger.hpp"
|
||||
@@ -36,7 +36,7 @@ namespace QodeAssist::Providers {
|
||||
|
||||
OpenAIResponsesProvider::OpenAIResponsesProvider(QObject *parent)
|
||||
: PluginLLMCore::Provider(parent)
|
||||
, m_client(new ::LLMCore::OpenAIResponsesClient(QString(), QString(), QString(), this))
|
||||
, m_client(new ::LLMQore::OpenAIResponsesClient(QString(), QString(), QString(), this))
|
||||
{
|
||||
Tools::registerQodeAssistTools(m_client->tools());
|
||||
}
|
||||
@@ -53,17 +53,7 @@ QString OpenAIResponsesProvider::apiKey() const
|
||||
|
||||
QString OpenAIResponsesProvider::url() const
|
||||
{
|
||||
return "https://api.openai.com";
|
||||
}
|
||||
|
||||
QString OpenAIResponsesProvider::completionEndpoint() const
|
||||
{
|
||||
return "/v1/responses";
|
||||
}
|
||||
|
||||
QString OpenAIResponsesProvider::chatEndpoint() const
|
||||
{
|
||||
return "/v1/responses";
|
||||
return "https://api.openai.com/v1";
|
||||
}
|
||||
|
||||
void OpenAIResponsesProvider::prepareRequest(
|
||||
@@ -179,7 +169,7 @@ PluginLLMCore::ProviderCapabilities OpenAIResponsesProvider::capabilities() cons
|
||||
| PluginLLMCore::ProviderCapability::ModelListing;
|
||||
}
|
||||
|
||||
::LLMCore::BaseClient *OpenAIResponsesProvider::client() const
|
||||
::LLMQore::BaseClient *OpenAIResponsesProvider::client() const
|
||||
{
|
||||
return m_client;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LLMCore/OpenAIResponsesClient.hpp>
|
||||
#include <LLMQore/OpenAIResponsesClient.hpp>
|
||||
#include <pluginllmcore/Provider.hpp>
|
||||
|
||||
namespace QodeAssist::Providers {
|
||||
@@ -32,8 +32,6 @@ public:
|
||||
|
||||
QString name() const override;
|
||||
QString url() const override;
|
||||
QString completionEndpoint() const override;
|
||||
QString chatEndpoint() const override;
|
||||
void prepareRequest(
|
||||
QJsonObject &request,
|
||||
PluginLLMCore::PromptTemplate *prompt,
|
||||
@@ -45,11 +43,11 @@ public:
|
||||
PluginLLMCore::ProviderID providerID() const override;
|
||||
PluginLLMCore::ProviderCapabilities capabilities() const override;
|
||||
|
||||
::LLMCore::BaseClient *client() const override;
|
||||
::LLMQore::BaseClient *client() const override;
|
||||
QString apiKey() const override;
|
||||
|
||||
private:
|
||||
::LLMCore::OpenAIResponsesClient *m_client;
|
||||
::LLMQore::OpenAIResponsesClient *m_client;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Providers
|
||||
|
||||
Reference in New Issue
Block a user