Fix unbehavior settings of provider and template

This commit is contained in:
Petr Mironychev
2024-10-17 00:02:14 +02:00
parent 80eda8c167
commit 2257e6e45f
2 changed files with 10 additions and 8 deletions

View File

@ -43,8 +43,8 @@ void PromptTemplateManager::setCurrentFimTemplate(const QString &name)
PromptTemplate *PromptTemplateManager::getCurrentFimTemplate()
{
if (m_currentFimTemplate == nullptr) {
LOG_MESSAGE("Current fim provider is null");
return nullptr;
LOG_MESSAGE("Current fim provider is null, return first");
return m_fimTemplates.first();
}
return m_currentFimTemplate;
@ -63,8 +63,10 @@ void PromptTemplateManager::setCurrentChatTemplate(const QString &name)
PromptTemplate *PromptTemplateManager::getCurrentChatTemplate()
{
if (m_currentChatTemplate == nullptr)
LOG_MESSAGE("Current chat provider is null");
if (m_currentChatTemplate == nullptr) {
LOG_MESSAGE("Current chat provider is null, return first");
return m_chatTemplates.first();
}
return m_currentChatTemplate;
}