fix: Add file name to prompt when processing images with doc (#4114)
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2025-09-25 18:51:21 +08:00 committed by GitHub
parent d70d6e1fa7
commit d92dcd722b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,7 +44,7 @@ def image_to_mode(image, doc: Document, images_list, get_image_id):
if len([i for i in images_list if i.id == image_uuid]) == 0:
image = File(id=image_uuid, file_name=part.filename, meta={'debug': False, 'content': part.blob})
images_list.append(image)
return f'![](./oss/file/{image_uuid})'
return f'![{part.filename.replace("[", "").replace("]", "")}](./oss/file/{image_uuid})'
return None
return None