mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-22 15:04:42 -04:00
refactor: Inject settings into LLMClientInterface (#114)
This reduces reliance on global state and makes it more possible to test the code.
This commit is contained in:
committed by
GitHub
parent
3a494d5254
commit
6c323642e4
@ -25,6 +25,8 @@
|
||||
#include <context/ProgrammingLanguage.hpp>
|
||||
#include <llmcore/ContextData.hpp>
|
||||
#include <llmcore/RequestHandler.hpp>
|
||||
#include <settings/CodeCompletionSettings.hpp>
|
||||
#include <settings/GeneralSettings.hpp>
|
||||
|
||||
class QNetworkReply;
|
||||
class QNetworkAccessManager;
|
||||
@ -36,7 +38,9 @@ class LLMClientInterface : public LanguageClient::BaseClientInterface
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LLMClientInterface();
|
||||
LLMClientInterface(
|
||||
const Settings::GeneralSettings &generalSettings,
|
||||
const Settings::CodeCompletionSettings &completeSettings);
|
||||
|
||||
Utils::FilePath serverDeviceTemplate() const override;
|
||||
|
||||
@ -61,6 +65,8 @@ private:
|
||||
LLMCore::ContextData prepareContext(
|
||||
const QJsonObject &request, const QStringView &accumulatedCompletion = QString{});
|
||||
|
||||
const Settings::CodeCompletionSettings &m_completeSettings;
|
||||
const Settings::GeneralSettings &m_generalSettings;
|
||||
LLMCore::RequestHandler m_requestHandler;
|
||||
QElapsedTimer m_completionTimer;
|
||||
QMap<QString, qint64> m_requestStartTimes;
|
||||
|
Reference in New Issue
Block a user