mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
feat: Add image file name to image messages
This commit is contained in:
parent
1c2bd55caf
commit
b0379aa720
1 changed files with 3 additions and 2 deletions
|
@ -598,9 +598,10 @@ class Coder:
|
||||||
mime_type, _ = mimetypes.guess_type(fname)
|
mime_type, _ = mimetypes.guess_type(fname)
|
||||||
if mime_type and mime_type.startswith("image/"):
|
if mime_type and mime_type.startswith("image/"):
|
||||||
image_url = f"data:{mime_type};base64,{content}"
|
image_url = f"data:{mime_type};base64,{content}"
|
||||||
image_messages.append(
|
image_messages += [
|
||||||
|
{"type": "text", "text": fname},
|
||||||
{"type": "image_url", "image_url": {"url": image_url, "detail": "high"}}
|
{"type": "image_url", "image_url": {"url": image_url, "detail": "high"}}
|
||||||
)
|
]
|
||||||
|
|
||||||
if not image_messages:
|
if not image_messages:
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue