We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8ef7b0 commit 33a4d1bCopy full SHA for 33a4d1b
1 file changed
backend/open_webui/utils/middleware.py
@@ -2054,13 +2054,16 @@ async def convert_url_images_to_base64(form_data):
2054
continue
2055
2056
try:
2057
- base64_data = await asyncio.to_thread(get_image_base64_from_url, image_url)
2058
- new_content.append(
2059
- {
2060
- 'type': 'image_url',
2061
- 'image_url': {'url': base64_data},
2062
- }
2063
- )
+ base64_data = await get_image_base64_from_url(image_url)
+ if base64_data:
+ new_content.append(
+ {
+ 'type': 'image_url',
+ 'image_url': {'url': base64_data},
+ }
2064
+ )
2065
+ else:
2066
+ new_content.append(item)
2067
except Exception as e:
2068
log.debug(f'Error converting image URL to base64: {e}')
2069
new_content.append(item)
0 commit comments