feat: allow negative values for the Relevance Threshold setting (#33330)

The Relevance Threshold field in the Documents settings refused negative values, so admins whose reranker returns raw scores (which can go below zero) could not set a useful threshold, and a negative RAG_RELEVANCE_THRESHOLD made the whole Documents settings page impossible to save while hybrid search was on. The server already stores and applies negative thresholds; only the field blocked them. The field now takes negative values in the same 0.01 steps as before, its help text says they are valid for rerankers that return raw scores outside the 0 to 1 range, and the hover hint asking for a value between 0 and 1 is gone. Nothing changes for 0 and above, and 0 still means no threshold.

Closes #29888
This commit is contained in:
Classic298 2026-10-28 22:20:50 +02:00 • committed by GitHub
parent e49ff5df64
commit 34ef99dbfb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 3 deletions

View file

@ -1431,8 +1431,6 @@
placeholder={$i18n.t('Enter Score')}
bind:value={RAGConfig.RELEVANCE_THRESHOLD}
autocomplete="off"
min="0.0"
title={$i18n.t('The score should be a value between 0.0 (0%) and 1.0 (100%).')}
/>
</AdminSettingField>

View file

@ -2878,7 +2878,7 @@
"settings.admin.documents.reindex.label": "Reindex",
"settings.admin.documents.reindexKnowledgeAndMemoryVectors.description": "Rebuild vectors for existing knowledge files, knowledge search, and memories.",
"settings.admin.documents.reindexKnowledgeAndMemoryVectors.label": "Reindex Knowledge and Memory Vectors",
"settings.admin.documents.relevanceThreshold.description": "Only return documents with a score greater than or equal to this value.",
"settings.admin.documents.relevanceThreshold.description": "Only return documents with a score greater than or equal to this value. Negative values are valid for rerankers that return raw scores outside the 0 to 1 range.",
"settings.admin.documents.relevanceThreshold.label": "Relevance Threshold",
"settings.admin.documents.rerankingBatchSize.description": "Number of results processed per reranking batch.",
"settings.admin.documents.rerankingBatchSize.label": "Reranking Batch Size",