Brushed up the backend, added writing task 1 academic prompt gen and grading ENCOA-274
This commit is contained in:
10
ielts_be/utils/image_to_b64.py
Normal file
10
ielts_be/utils/image_to_b64.py
Normal file
@@ -0,0 +1,10 @@
|
||||
def _b64_vision_images(path: str):
|
||||
for filename in os.listdir(path):
|
||||
if filename.startswith("cv-") and filename.endswith(".png"):
|
||||
cv_dict.append({
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": f"data:image/png;base64,{_encode_image(os.path.join(path, filename))}"
|
||||
}
|
||||
})
|
||||
return cv_dict
|
||||
Reference in New Issue
Block a user