From eebebd64f14ac14cc58b40d02f94a4d7d749332d Mon Sep 17 00:00:00 2001 From: Folzo Date: Sat, 11 Apr 2026 02:17:57 +0200 Subject: [PATCH] fix(effi-ocr): explicitly set content-type from mimetypes when sending file --- effi-ocr-legacy/TOOL-OPENWEBUI.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/effi-ocr-legacy/TOOL-OPENWEBUI.md b/effi-ocr-legacy/TOOL-OPENWEBUI.md index ad1213a..e01cb5e 100644 --- a/effi-ocr-legacy/TOOL-OPENWEBUI.md +++ b/effi-ocr-legacy/TOOL-OPENWEBUI.md @@ -42,8 +42,14 @@ class Tools: available = self._list_files() return "[ERROR] File not found: " + image_path + "\n\nAvailable files:\n" + available + import mimetypes + mime_type, _ = mimetypes.guess_type(file_path) + mime_type = mime_type or 'image/jpeg' + with open(file_path, 'rb') as f: - files = {'file': (os.path.basename(file_path), f)} + files = { + 'file': (os.path.basename(file_path), f, mime_type) + } data = {'lang': self._normalize_language(language), 'preprocess': 'true'} response = requests.post(