MCPcopy Create free account
hub / github.com/AmberSahdev/Open-Interface / get_screenshot_as_file_object

Method get_screenshot_as_file_object

app/utils/screen.py:27–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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:

Callers 1

Calls 1

get_screenshotMethod · 0.95

Tested by

no test coverage detected