From da2cb0a796e0cef9bec69220b004144cfc489241 Mon Sep 17 00:00:00 2001 From: rong-xyz Date: Thu, 24 Apr 2025 06:10:24 +0000 Subject: [PATCH] fix image type --- packages/markitup/src/markitup/_base_converter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/markitup/src/markitup/_base_converter.py b/packages/markitup/src/markitup/_base_converter.py index f8e02a3..7207bd2 100644 --- a/packages/markitup/src/markitup/_base_converter.py +++ b/packages/markitup/src/markitup/_base_converter.py @@ -87,10 +87,11 @@ class DocumentConverterResult: # Add the image content.append({ "type": "image", - "image_url": { - "url": f"data:{content_type};base64,{b64_data}" + "source": { + "type": "base64", + "data": b64_data, + "media_type": content_type }, - "alt_text": alt_text }) last_end = match.end() @@ -104,7 +105,6 @@ class DocumentConverterResult: "text": text_chunk }) if self.audio_stream: - print('hello') audio_b64 = base64.b64encode( self.audio_stream.read()).decode('utf-8') content.append({