|
| 1 | +/* |
| 2 | + * Copyright (C) 2025 Povilas Kanapickas <[email protected]> |
| 3 | + * |
| 4 | + * This file is part of QodeAssist. |
| 5 | + * |
| 6 | + * QodeAssist is free software: you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU General Public License as published by |
| 8 | + * the Free Software Foundation, either version 3 of the License, or |
| 9 | + * (at your option) any later version. |
| 10 | + * |
| 11 | + * QodeAssist is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU General Public License |
| 17 | + * along with QodeAssist. If not, see <https://www.gnu.org/licenses/>. |
| 18 | + */ |
| 19 | + |
| 20 | +#pragma once |
| 21 | + |
| 22 | +#include "IPromptProvider.hpp" |
| 23 | +#include "PromptTemplate.hpp" |
| 24 | +#include "PromptTemplateManager.hpp" |
| 25 | + |
| 26 | +namespace QodeAssist::LLMCore { |
| 27 | + |
| 28 | +class PromptProviderChat : public IPromptProvider |
| 29 | +{ |
| 30 | +public: |
| 31 | + explicit PromptProviderChat(PromptTemplateManager &templateManager) |
| 32 | + : m_templateManager(templateManager) |
| 33 | + {} |
| 34 | + |
| 35 | + ~PromptProviderChat() = default; |
| 36 | + |
| 37 | + PromptTemplate *getTemplateByName(const QString &templateName) const override |
| 38 | + { |
| 39 | + return m_templateManager.getChatTemplateByName(templateName); |
| 40 | + } |
| 41 | + |
| 42 | + QStringList templatesNames() const override { return m_templateManager.chatTemplatesNames(); } |
| 43 | + |
| 44 | + QStringList getTemplatesForProvider(ProviderID id) const override |
| 45 | + { |
| 46 | + return m_templateManager.getChatTemplatesForProvider(id); |
| 47 | + } |
| 48 | + |
| 49 | +private: |
| 50 | + PromptTemplateManager &m_templateManager; |
| 51 | +}; |
| 52 | + |
| 53 | +} // namespace QodeAssist::LLMCore |
0 commit comments