diff --git a/application/api/answer/routes.py b/application/api/answer/routes.py index bd1fa21f..b122eac1 100644 --- a/application/api/answer/routes.py +++ b/application/api/answer/routes.py @@ -207,7 +207,9 @@ def stream(): prompt_id = data["prompt_id"] else: prompt_id = 'default' - if 'chunks' in data: + if 'selectedDocs' in data and data['selectedDocs'] is None: + chunks = 0 + elif 'chunks' in data: chunks = int(data["chunks"]) else: chunks = 2 diff --git a/frontend/src/components/SourceDropdown.tsx b/frontend/src/components/SourceDropdown.tsx index 04b95d7c..353d49db 100644 --- a/frontend/src/components/SourceDropdown.tsx +++ b/frontend/src/components/SourceDropdown.tsx @@ -24,6 +24,12 @@ function SourceDropdown({ const embeddingsName = import.meta.env.VITE_EMBEDDINGS_NAME || 'huggingface_sentence-transformers/all-mpnet-base-v2'; + + const handleEmptyDocumentSelect = () => { + dispatch(setSelectedDocs(null)); + setIsDocsListOpen(false); + }; + return (