open-webui/backend/open_webui
google-labs-jules[bot] 4a7e1b93e5 Fix: Prevent RAG queries when all files are in full context
This commit fixes an issue where Retrieval-Augmented Generation (RAG)
queries were still being generated even when all attached files were set
to 'full context' mode. This was inefficient as the full content of the
files was already available to the model.

The `chat_completion_files_handler` in `backend/open_webui/utils/middleware.py`
has been updated to:
- Check if all attached files have the `context: 'full'` property.
- Skip the `generate_queries` step if all files are in full context mode.
- Pass a `full_context=True` flag to the `get_sources_from_items`
  function to ensure it fetches the entire document content instead of
  performing a vector search.

This change ensures that RAG queries are only generated when necessary,
improving the efficiency of the system.
2025-09-25 15:54:58 +00:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal refactor: format 2025-08-10 22:28:31 +08:00
migrations feat: server-side OAuth token management system 2025-09-08 18:05:43 +04:00
models feat: channel/thread @ model 2025-09-17 00:49:44 -05:00
retrieval refac/fix: knowledge permission 2025-09-15 11:40:31 -05:00
routers refac 2025-09-17 11:28:04 -05:00
socket refac 2025-08-28 13:25:48 +04:00
static refac 2025-08-10 00:02:58 +04:00
storage refac/fix: s3 checksum validation 2025-08-21 12:44:16 +04:00
test chore: format, lint 2025-07-16 15:23:18 +09:00
utils Fix: Prevent RAG queries when all files are in full context 2025-09-25 15:54:58 +00:00
__init__.py Update __init__.py 2025-04-15 09:55:35 +02:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac: granular onedrive integration types 2025-09-16 10:54:13 -05:00
constants.py feat: follow ups 2025-06-03 18:07:29 +04:00
env.py feat: server-side OAuth token management system 2025-09-08 18:05:43 +04:00
functions.py refac 2025-09-16 16:15:52 -05:00
main.py fix: onedrive 2025-09-17 12:18:23 -05:00
tasks.py fix: fix error when stopping non-existent task 2025-09-04 16:52:19 +08:00