get rid of silly ollamaIsEnabled

This commit is contained in:
perf3ct 2025-04-01 19:41:30 +00:00
parent 9719859a39
commit afe1de5ed3
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
3 changed files with 7 additions and 8 deletions

View File

@ -790,9 +790,9 @@ export default class LlmChatPanel extends BasicWidget {
enabledProviders.push('anthropic');
}
// Ollama is enabled if the setting is true
const ollamaEnabled = options.is('ollamaEnabled');
if (ollamaEnabled) {
// Ollama is enabled if base URL is set
const ollamaBaseUrl = options.get('ollamaBaseUrl');
if (ollamaBaseUrl) {
enabledProviders.push('ollama');
}

View File

@ -287,10 +287,9 @@ export async function initializeDefaultProviders() {
}
}
// Register Ollama provider if enabled
if (await options.getOptionBool('ollamaEnabled')) {
const ollamaBaseUrl = await options.getOption('ollamaBaseUrl') || 'http://localhost:11434';
// Register Ollama provider if base URL is configured
const ollamaBaseUrl = await options.getOption('ollamaBaseUrl');
if (ollamaBaseUrl) {
// Use specific embedding models if available
const embeddingModel = await options.getOption('ollamaEmbeddingModel') || 'nomic-embed-text';

View File

@ -189,7 +189,7 @@ const defaultOptions: DefaultOption[] = [
{ name: "anthropicBaseUrl", value: "https://api.anthropic.com/v1", isSynced: true },
{ name: "ollamaEnabled", value: "false", isSynced: true },
{ name: "ollamaDefaultModel", value: "llama3", isSynced: true },
{ name: "ollamaBaseUrl", value: "http://localhost:11434", isSynced: true },
{ name: "ollamaBaseUrl", value: "", isSynced: true },
{ name: "ollamaEmbeddingModel", value: "nomic-embed-text", isSynced: true },
{ name: "embeddingAutoUpdateEnabled", value: "true", isSynced: true },