From 263a942585456b7d03b58aff83aaa9ab203767dc Mon Sep 17 00:00:00 2001 From: Folzo Date: Sat, 11 Apr 2026 02:42:54 +0200 Subject: [PATCH] fix(kreuzberg): fix 'read of closed file' error by reading file content before requests --- effi-kreuzberg/TOOL-OPENWEBUI.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/effi-kreuzberg/TOOL-OPENWEBUI.md b/effi-kreuzberg/TOOL-OPENWEBUI.md index d5fbcf7..f1decee 100644 --- a/effi-kreuzberg/TOOL-OPENWEBUI.md +++ b/effi-kreuzberg/TOOL-OPENWEBUI.md @@ -73,9 +73,11 @@ class Tools: mime_type = mime_type or 'application/octet-stream' with open(file_path, 'rb') as f: - files = { - 'files': (os.path.basename(file_path), f, mime_type) - } + file_content = f.read() + + files = { + 'files': (os.path.basename(file_path), io.BytesIO(file_content), mime_type) + } data = { 'image_export_mode': 'inline',