mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
Implemented a temporary solution to convert file names to media types for image files.
This commit is contained in:
parent
5e26014dae
commit
0ef842dd53
1 changed files with 1 additions and 0 deletions
|
@ -575,6 +575,7 @@ class Coder:
|
||||||
image_messages = []
|
image_messages = []
|
||||||
for fname, content in self.get_abs_fnames_content():
|
for fname, content in self.get_abs_fnames_content():
|
||||||
if is_image_file(fname):
|
if is_image_file(fname):
|
||||||
|
# todo: use a proper tool to convert fname to media type
|
||||||
image_url = f"data:image/{Path(fname).suffix.lstrip('.')};base64,{content}"
|
image_url = f"data:image/{Path(fname).suffix.lstrip('.')};base64,{content}"
|
||||||
image_messages.append(
|
image_messages.append(
|
||||||
{"type": "image_url", "image_url": {"url": image_url, "detail": "high"}}
|
{"type": "image_url", "image_url": {"url": image_url, "detail": "high"}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue