mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 05:24:02 +00:00
refac: default rag template
This commit is contained in:
parent
b38986a0aa
commit
cb9e76c7f9
@ -69,6 +69,7 @@ from open_webui.config import (
|
|||||||
RAG_RERANKING_MODEL,
|
RAG_RERANKING_MODEL,
|
||||||
RAG_RERANKING_MODEL_AUTO_UPDATE,
|
RAG_RERANKING_MODEL_AUTO_UPDATE,
|
||||||
RAG_RERANKING_MODEL_TRUST_REMOTE_CODE,
|
RAG_RERANKING_MODEL_TRUST_REMOTE_CODE,
|
||||||
|
DEFAULT_RAG_TEMPLATE,
|
||||||
RAG_TEMPLATE,
|
RAG_TEMPLATE,
|
||||||
RAG_TOP_K,
|
RAG_TOP_K,
|
||||||
RAG_WEB_SEARCH_CONCURRENT_REQUESTS,
|
RAG_WEB_SEARCH_CONCURRENT_REQUESTS,
|
||||||
@ -660,7 +661,7 @@ async def update_query_settings(
|
|||||||
form_data: QuerySettingsForm, user=Depends(get_admin_user)
|
form_data: QuerySettingsForm, user=Depends(get_admin_user)
|
||||||
):
|
):
|
||||||
app.state.config.RAG_TEMPLATE = (
|
app.state.config.RAG_TEMPLATE = (
|
||||||
form_data.template if form_data.template else RAG_TEMPLATE
|
form_data.template if form_data.template != "" else DEFAULT_RAG_TEMPLATE
|
||||||
)
|
)
|
||||||
app.state.config.TOP_K = form_data.k if form_data.k else 4
|
app.state.config.TOP_K = form_data.k if form_data.k else 4
|
||||||
app.state.config.RELEVANCE_THRESHOLD = form_data.r if form_data.r else 0.0
|
app.state.config.RELEVANCE_THRESHOLD = form_data.r if form_data.r else 0.0
|
||||||
|
@ -732,11 +732,17 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class=" mb-2.5 text-sm font-medium">{$i18n.t('RAG Template')}</div>
|
<div class=" mb-2.5 text-sm font-medium">{$i18n.t('RAG Template')}</div>
|
||||||
<textarea
|
<Tooltip
|
||||||
bind:value={querySettings.template}
|
content={$i18n.t('Leave empty to use the default prompt, or enter a custom prompt')}
|
||||||
class="w-full rounded-lg px-4 py-3 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none resize-none"
|
placement="top-start"
|
||||||
rows="4"
|
>
|
||||||
/>
|
<textarea
|
||||||
|
bind:value={querySettings.template}
|
||||||
|
placeholder={$i18n.t('Leave empty to use the default prompt, or enter a custom prompt')}
|
||||||
|
class="w-full rounded-lg px-4 py-3 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none resize-none"
|
||||||
|
rows="4"
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user