open-webui/backend/open_webui/utils
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
..
images fix max seed for comfyui 2025-02-08 01:10:18 +07:00
telemetry refac: otel metrics handle 500 2025-09-16 12:11:32 -05:00
access_control.py fix: send notification 2025-09-16 22:53:54 -05:00
audit.py Fix audit get_current_user 2025-08-10 02:10:00 +02:00
auth.py refac 2025-09-08 18:17:11 +04:00
channels.py feat: channel/thread @ model 2025-09-17 00:49:44 -05:00
chat.py fix: action reserved user param 2025-06-18 10:50:49 +04:00
code_interpreter.py chore: format 2025-05-10 19:00:01 +04:00
embeddings.py refac: embeddings endpoint 2025-06-05 00:37:31 +04:00
filter.py fix: setting file_handler in a filter would generate errors in messages with no files, because a "files: Null" in metadata would trigger an attempt to delete a non existent files object 2025-09-13 12:57:54 -03:00
logger.py chore: format 2025-08-06 14:27:58 +04:00
middleware.py Fix: Prevent RAG queries when all files are in full context 2025-09-25 15:54:58 +00:00
misc.py feat: ref chat 2025-09-14 10:26:46 +02:00
models.py refac 2025-09-16 23:19:21 -05:00
oauth.py chore: format 2025-09-16 11:16:08 -05:00
payload.py enh: custom reasoning tags 2025-08-27 17:24:16 +04:00
pdf_generator.py chore: remove unnecessary Path conversions 2025-03-04 19:53:52 +02:00
plugin.py fix: None Type tool installation during startup 2025-08-20 23:58:08 +04:00
redis.py enh/refac: redis cluster support 2025-08-04 14:15:08 +04:00
response.py fix: ollama tool call 2025-07-18 06:11:53 +08:00
security_headers.py chore: format 2024-11-30 23:36:30 -08:00
task.py refac 2025-08-21 04:46:43 +04:00
tools.py refac: tool server data handling 2025-09-09 19:00:01 +04:00
webhook.py refac: async webhook request 2025-08-15 00:07:02 +04:00