fix(kreuzberg): fix 'read of closed file' error by reading file content before requests

This commit is contained in:
Folzo
2026-04-11 02:42:54 +02:00
parent b72dafd66b
commit 263a942585
+5 -3
View File
@@ -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',