diff --git a/src/lib/components/workspace/common/RagConfigModal.svelte b/src/lib/components/workspace/common/RagConfigModal.svelte new file mode 100644 index 000000000..afc5b9358 --- /dev/null +++ b/src/lib/components/workspace/common/RagConfigModal.svelte @@ -0,0 +1,871 @@ + + + +
+
+ +
+
+ {$i18n.t('RAG Configuration')} +
+ +
+ + +
+
+ {$i18n.t('Content Extraction Engine')} +
+
+ +
+
+
+ {#if localRAGConfig.CONTENT_EXTRACTION_ENGINE === ''} +
+
+
+ {$i18n.t('PDF Extract Images (OCR)')} +
+
+ +
+
+
+ {:else if RAGConfig.CONTENT_EXTRACTION_ENGINE === 'external'} +
+ + +
+ {:else if localRAGConfig.CONTENT_EXTRACTION_ENGINE === 'tika'} +
+
+ +
+
+ {:else if localRAGConfig.CONTENT_EXTRACTION_ENGINE === 'docling'} +
+ +
+ {:else if localRAGConfig.CONTENT_EXTRACTION_ENGINE === 'document_intelligence'} +
+ + +
+ {:else if localRAGConfig.CONTENT_EXTRACTION_ENGINE === 'mistral_ocr'} +
+ +
+ {/if} +
+ +
+
+ + {$i18n.t('Bypass Embedding and Retrieval')} + +
+
+ + + +
+
+ + {#if !localRAGConfig.BYPASS_EMBEDDING_AND_RETRIEVAL} +
+
{$i18n.t('Text Splitter')}
+
+ +
+
+ +
+
+
+
+ {$i18n.t('Chunk Size')} +
+
+ +
+
+ +
+
+ {$i18n.t('Chunk Overlap')} +
+ +
+ +
+
+
+
+ {/if} + + {#if !localRAGConfig.BYPASS_EMBEDDING_AND_RETRIEVAL} +
+
{$i18n.t('Embedding')}
+ +
+ +
+
+
+ {$i18n.t('Embedding Model Engine')} +
+
+ +
+
+ + {#if embeddingEngine === 'openai'} +
+ + + +
+ {:else if embeddingEngine === 'ollama'} +
+ + + +
+ {/if} +
+ +
+
{$i18n.t('Embedding Model')}
+ {#if $user?.role === 'admin'} +
+ {#if embeddingEngine === 'ollama'} +
+
+ { + }} + /> +
+
+ {:else} +
+
+ { + }} + /> +
+ + {#if embeddingEngine === ''} + + {/if} +
+ {/if} +
+ {/if} + +
+
+ +
+
+ +
+ {$i18n.t( + 'Warning: If you update or change your embedding model, you will need to re-import all documents.' + )} +
+
+ + + {#if embeddingEngine === 'ollama' || embeddingEngine === 'openai'} +
+
+ {$i18n.t('Embedding Batch Size')} +
+ +
+ +
+
+ {/if} +
+ +
+
{$i18n.t('Retrieval')}
+ +
+ +
+
{$i18n.t('Full Context Mode')}
+
+ + + +
+
+ + {#if !localRAGConfig.RAG_FULL_CONTEXT} +
+
{$i18n.t('Hybrid Search')}
+
+ { + if (!localRAGConfig.ENABLE_RAG_HYBRID_SEARCH) { + localRAGConfig.RAG_RERANKING_MODEL = ""; + } + }} + /> +
+
+ + {#if localRAGConfig.ENABLE_RAG_HYBRID_SEARCH === true} +
+
+
+ {$i18n.t('Reranking Engine')} +
+
+ +
+
+ + {#if localRAGConfig.RAG_RERANKING_ENGINE === 'external'} +
+ + + +
+ {/if} +
+ + {#if localRAGConfig.ENABLE_RAG_HYBRID_SEARCH === true} +
+
{$i18n.t('Reranking Model')}
+ {#if $user?.role === 'admin'} +
+
+
+ { + }} + /> +
+
+
+ {/if} +
+
+ +
+
+
+ {/if} + +
+
{$i18n.t('Top K')}
+
+ +
+
+ +
+
{$i18n.t('Top K Reranker')}
+
+ +
+
+ {/if} + + {#if localRAGConfig.ENABLE_RAG_HYBRID_SEARCH === true} +
+
+
+ {$i18n.t('Relevance Threshold')} +
+
+ +
+
+
+ {$i18n.t( + 'Note: If you set a minimum score, the search will only return documents with a score greater than or equal to the minimum score.' + )} +
+
+ {/if} + {/if} + +
+
{$i18n.t('RAG Template')}
+
+ +