mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-18 04:54:30 -04:00
feat: Add automatic template handling for Ollama models (#43)
* feat: Add automatic template handling for Ollama models - Add OllamaAutoFim - Use native Ollama API format when possible - Remove need for manual template selection for most Ollama models - Default to model-specific format from Ollama modelfile - Fallback to manual template selection if needed This change simplifies configuration by automatically using the correct template format for each Ollama model.
This commit is contained in:
@ -73,10 +73,20 @@ void ClientInterface::sendMessage(const QString &message, bool includeCurrentFil
|
||||
auto providerName = Settings::generalSettings().caProvider();
|
||||
auto provider = LLMCore::ProvidersManager::instance().getProviderByName(providerName);
|
||||
|
||||
if (!provider) {
|
||||
LOG_MESSAGE(QString("No provider found with name: %1").arg(providerName));
|
||||
return;
|
||||
}
|
||||
|
||||
auto templateName = Settings::generalSettings().caTemplate();
|
||||
auto promptTemplate = LLMCore::PromptTemplateManager::instance().getChatTemplateByName(
|
||||
templateName);
|
||||
|
||||
if (!promptTemplate) {
|
||||
LOG_MESSAGE(QString("No template found with name: %1").arg(templateName));
|
||||
return;
|
||||
}
|
||||
|
||||
LLMCore::ContextData context;
|
||||
context.prefix = message;
|
||||
context.suffix = "";
|
||||
|
Reference in New Issue
Block a user