(self)
| 19 | return img |
| 20 | |
| 21 | def get_screenshot_in_base64(self) -> str: |
| 22 | # Base64 images work with ChatCompletions API but not Assistants API |
| 23 | img_bytes = self.get_screenshot_as_file_object() |
| 24 | encoded_image = base64.b64encode(img_bytes.read()).decode('utf-8') |
| 25 | return encoded_image |
| 26 | |
| 27 | def get_screenshot_as_file_object(self): |
| 28 | # In memory files don't work with OpenAI Assistants API because of missing filename attribute |
no test coverage detected