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

Method get_screenshot_in_base64

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

Source from the content-addressed store, hash-verified

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

Callers 2

Calls 1

Tested by

no test coverage detected