(image_path: Path)
| 510 | |
| 511 | |
| 512 | def encode_image_to_base64(image_path: Path) -> str: |
| 513 | |
| 514 | image_data = compress_image_if_needed(image_path) |
| 515 | encoded_string = base64.b64encode(image_data).decode('utf-8') |
| 516 | |
| 517 | if image_data.startswith(b'\xff\xd8\xff'): |
| 518 | return f"data:image/jpeg;base64,{encoded_string}" |
| 519 | else: |
| 520 | return f"data:image/png;base64,{encoded_string}" |
| 521 | |
| 522 | |
| 523 | def create_evaluation_request(difficulty: str, category: str, data_info: str, image_path:str, |
no test coverage detected