refactor: Decouple prompt template manager from their users (#115)

This makes it possible to test the user classes
This commit is contained in:
Povilas Kanapickas
2025-03-10 03:13:10 +02:00
committed by GitHub
parent b6f36d61ae
commit 98e1047bf1
13 changed files with 179 additions and 20 deletions

View File

@ -25,6 +25,7 @@
#include "ChatModel.hpp"
#include "RequestHandler.hpp"
#include "llmcore/IPromptProvider.hpp"
namespace QodeAssist::Chat {
@ -33,7 +34,8 @@ class ClientInterface : public QObject
Q_OBJECT
public:
explicit ClientInterface(ChatModel *chatModel, QObject *parent = nullptr);
explicit ClientInterface(
ChatModel *chatModel, LLMCore::IPromptProvider *promptProvider, QObject *parent = nullptr);
~ClientInterface();
void sendMessage(
@ -53,8 +55,9 @@ private:
QString getSystemPromptWithLinkedFiles(
const QString &basePrompt, const QList<QString> &linkedFiles) const;
LLMCore::RequestHandler *m_requestHandler;
LLMCore::IPromptProvider *m_promptProvider = nullptr;
ChatModel *m_chatModel;
LLMCore::RequestHandler *m_requestHandler;
};
} // namespace QodeAssist::Chat