diff --git a/src/lib/components/workspace/Knowledge/CreateKnowledgeBase.svelte b/src/lib/components/workspace/Knowledge/CreateKnowledgeBase.svelte index dd25fc881..94cdbf8f6 100644 --- a/src/lib/components/workspace/Knowledge/CreateKnowledgeBase.svelte +++ b/src/lib/components/workspace/Knowledge/CreateKnowledgeBase.svelte @@ -548,90 +548,121 @@
{$i18n.t('Embedding Model')}
- -
- {#if embeddingEngine === 'ollama'} -
-
- -
-
- {:else} -
-
- + {#if $user?.role === 'admin'} +
+ {#if embeddingEngine === 'ollama'} +
+
+ +
+ {:else} +
+
+ +
- {#if embeddingEngine === ''} - - {/if} + {/if} + + {/if} +
+ {/if} +
+ {/if} +
+
+
- {/if} -
- +
{$i18n.t( 'Warning: If you update or change your embedding model, you will need to re-import all documents.' @@ -694,71 +725,102 @@ {#if RAGConfig.ENABLE_RAG_HYBRID_SEARCH === true}
{$i18n.t('Reranking Model')}
- -
-
-
- -
-
- {:else} - - - - + {/if} + + +
+
+ {/if} +
+
+
diff --git a/src/lib/components/workspace/common/RagConfigModal.svelte b/src/lib/components/workspace/common/RagConfigModal.svelte index f97ae9188..33ed1149e 100644 --- a/src/lib/components/workspace/common/RagConfigModal.svelte +++ b/src/lib/components/workspace/common/RagConfigModal.svelte @@ -231,7 +231,11 @@ embedding_batch_size, openai_config, ollama_config, - reranking_model, + reranking_model, + LOADED_EMBEDDING_MODELS, + DOWNLOADED_EMBEDDING_MODELS, + LOADED_RERANKING_MODELS, + DOWNLOADED_RERANKING_MODELS, ...filteredRAGConfig } = localRAGConfig; @@ -247,6 +251,16 @@ await rerankingModelUpdateHandler(); } } + + // Update embedding and reranking to show updates in UI + localRAGConfig.embedding_engine = embeddingEngine + localRAGConfig.embedding_model = embeddingModel + localRAGConfig.embedding_batch_size = embeddingBatchSize + localRAGConfig.openai_config = {"key": OpenAIKey, "url": OpenAIUrl} + localRAGConfig.ollama_config = {"key": OllamaKey, "url": OllamaUrl} + localRAGConfig.reranking_model = rerankingModel + + console.log('RAGConfig:', localRAGConfig); dispatch('update', localRAGConfig) loading = false; @@ -487,98 +501,136 @@ {/if}
-
-
{$i18n.t('Embedding Model')}
+
+
{$i18n.t('Embedding Model')}
+ {#if $user?.role === 'admin'} +
+ {#if embeddingEngine === 'ollama'} +
+
+ { + }} + /> +
+
+ {:else} +
+
+ { + }} + /> +
-
- {#if embeddingEngine === 'ollama'} -
-
- -
-
- {:else} -
-
- -
- - {#if embeddingEngine === ''} - {/if} - +
{/if}
- {/if} + {/if} + +
+
+ +
+
+ +
+ {$i18n.t( + 'Warning: If you update or change your embedding model, you will need to re-import all documents.' + )} +
-
- {$i18n.t( - 'Warning: If you update or change your embedding model, you will need to re-import all documents.' - )} -
-
{#if embeddingEngine === 'ollama' || embeddingEngine === 'openai'}
@@ -635,71 +687,101 @@ {#if localRAGConfig.ENABLE_RAG_HYBRID_SEARCH === true}
{$i18n.t('Reranking Model')}
- -
-
-
- -
-
- {:else} - - - - + {/if} + +
+
+ {/if} +
+
+