(self)
| 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 |
| 29 | img_bytes = io.BytesIO() |
| 30 | img = self.get_screenshot() |
| 31 | img.save(img_bytes, format='PNG') # Save the screenshot to an in-memory file. |
| 32 | img_bytes.seek(0) |
| 33 | return img_bytes |
| 34 | |
| 35 | def get_temp_filename_for_current_screenshot(self): |
| 36 | with tempfile.NamedTemporaryFile(delete=False, suffix='.png') as tmpfile: |
no test coverage detected