Skip to content

Commit

Permalink
Fix unbehavior settings of provider and template
Browse files Browse the repository at this point in the history
  • Loading branch information
Palm1r committed Oct 16, 2024
1 parent 80eda8c commit 2257e6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions llmcore/PromptTemplateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions llmcore/ProvidersManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ Provider *ProvidersManager::setCurrentChatProvider(const QString &name)
Provider *ProvidersManager::getCurrentFimProvider()
{
if (m_currentFimProvider == nullptr) {
LOG_MESSAGE("Current fim provider is null");
return nullptr;
LOG_MESSAGE("Current fim provider is null, return first");
return m_providers.first();
}

return m_currentFimProvider;
Expand All @@ -66,8 +66,8 @@ Provider *ProvidersManager::getCurrentFimProvider()
Provider *ProvidersManager::getCurrentChatProvider()
{
if (m_currentChatProvider == nullptr) {
LOG_MESSAGE("Current chat provider is null");
return nullptr;
LOG_MESSAGE("Current chat provider is null, return first");
return m_providers.first();
}

return m_currentChatProvider;
Expand Down

0 comments on commit 2257e6e

Please sign in to comment.