This commit is contained in:
Timothy Jaeryang Baek
2025-12-30 19:38:45 +04:00
parent 18a33a079b
commit 08bf4670ec
2 changed files with 19 additions and 1 deletions
+3
View File
@@ -496,6 +496,7 @@ async def get_rag_config(request: Request, user=Depends(get_admin_user)):
"RAG_EXTERNAL_RERANKER_TIMEOUT": request.app.state.config.RAG_EXTERNAL_RERANKER_TIMEOUT,
# Chunking settings
"TEXT_SPLITTER": request.app.state.config.TEXT_SPLITTER,
"ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER": request.app.state.config.ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER,
"CHUNK_SIZE": request.app.state.config.CHUNK_SIZE,
"CHUNK_OVERLAP": request.app.state.config.CHUNK_OVERLAP,
# File upload settings
@@ -685,6 +686,7 @@ class ConfigForm(BaseModel):
# Chunking settings
TEXT_SPLITTER: Optional[str] = None
ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER: Optional[bool] = None
CHUNK_SIZE: Optional[int] = None
CHUNK_OVERLAP: Optional[int] = None
@@ -1190,6 +1192,7 @@ async def update_rag_config(
# Chunking settings
"TEXT_SPLITTER": request.app.state.config.TEXT_SPLITTER,
"CHUNK_SIZE": request.app.state.config.CHUNK_SIZE,
"ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER": request.app.state.config.ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER,
"CHUNK_OVERLAP": request.app.state.config.CHUNK_OVERLAP,
# File upload settings
"FILE_MAX_SIZE": request.app.state.config.FILE_MAX_SIZE,
@@ -735,11 +735,26 @@
>
<option value="">{$i18n.t('Default')} ({$i18n.t('Character')})</option>
<option value="token">{$i18n.t('Token')} ({$i18n.t('Tiktoken')})</option>
<option value="markdown_header">{$i18n.t('Markdown (Header)')}</option>
</select>
</div>
</div>
<div class=" mb-2.5 flex w-full justify-between">
<div class=" self-center text-xs font-medium">
<Tooltip
placement="top-start"
content={$i18n.t(
'Split documents by markdown headers before applying character/token splitting.'
)}
>
{$i18n.t('Markdown Header Text Splitter')}
</Tooltip>
</div>
<div class="flex items-center relative">
<Switch bind:state={RAGConfig.ENABLE_MARKDOWN_HEADER_TEXT_SPLITTER} />
</div>
</div>
<div class=" mb-2.5 flex w-full justify-between">
<div class=" flex gap-1.5 w-full">
<div class=" w-full justify-between">