orgo 0.0.4__tar.gz → 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {orgo-0.0.4 → orgo-0.0.5}/PKG-INFO +1 -1
- {orgo-0.0.4 → orgo-0.0.5}/pyproject.toml +1 -1
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/computer.py +6 -16
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo.egg-info/PKG-INFO +1 -1
- {orgo-0.0.4 → orgo-0.0.5}/README.md +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/setup.cfg +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/__init__.py +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/adapters/__init__.py +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/adapters/anthropic.py +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/adapters/base.py +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/adapters/openai.py +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/api/__init__.py +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/api/client.py +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/utils/__init__.py +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo/utils/auth.py +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo.egg-info/SOURCES.txt +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo.egg-info/dependency_links.txt +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo.egg-info/requires.txt +0 -0
- {orgo-0.0.4 → orgo-0.0.5}/src/orgo.egg-info/top_level.txt +0 -0
|
@@ -3,31 +3,21 @@
|
|
|
3
3
|
import os
|
|
4
4
|
import io
|
|
5
5
|
import base64
|
|
6
|
-
from typing import Dict, Any
|
|
6
|
+
from typing import Dict, Any
|
|
7
7
|
from PIL import Image
|
|
8
8
|
|
|
9
9
|
from .api.client import ApiClient
|
|
10
10
|
|
|
11
11
|
class Computer:
|
|
12
|
-
def __init__(self, project_id
|
|
13
|
-
"""
|
|
14
|
-
Initialize a computer instance.
|
|
15
|
-
|
|
16
|
-
Args:
|
|
17
|
-
project_id: Existing project ID to connect to
|
|
18
|
-
api_key: API key for authentication (falls back to ORGO_API_KEY env var)
|
|
19
|
-
config: Configuration for creating a new computer
|
|
20
|
-
"""
|
|
12
|
+
def __init__(self, project_id=None, api_key=None, config=None):
|
|
21
13
|
self.api = ApiClient(api_key or os.environ.get("ORGO_API_KEY"))
|
|
22
|
-
self._info = {}
|
|
23
14
|
|
|
24
15
|
if project_id:
|
|
25
|
-
# Simply set the project ID if provided
|
|
26
16
|
self.project_id = project_id
|
|
17
|
+
self._info = self.api.connect_computer(project_id)
|
|
27
18
|
else:
|
|
28
|
-
# Create a new computer instance
|
|
29
19
|
response = self.api.create_computer(config)
|
|
30
|
-
self.project_id = response.get("
|
|
20
|
+
self.project_id = response.get("name")
|
|
31
21
|
self._info = response
|
|
32
22
|
|
|
33
23
|
if not self.project_id:
|
|
@@ -75,13 +65,13 @@ class Computer:
|
|
|
75
65
|
def screenshot(self) -> Image.Image:
|
|
76
66
|
"""Capture screenshot and return as PIL Image"""
|
|
77
67
|
response = self.api.get_screenshot(self.project_id)
|
|
78
|
-
img_data = base64.b64decode(response.get("
|
|
68
|
+
img_data = base64.b64decode(response.get("screenshot", ""))
|
|
79
69
|
return Image.open(io.BytesIO(img_data))
|
|
80
70
|
|
|
81
71
|
def screenshot_base64(self) -> str:
|
|
82
72
|
"""Capture screenshot and return as base64 string"""
|
|
83
73
|
response = self.api.get_screenshot(self.project_id)
|
|
84
|
-
return response.get("
|
|
74
|
+
return response.get("screenshot", "")
|
|
85
75
|
|
|
86
76
|
# Execution methods
|
|
87
77
|
def bash(self, command: str) -> str:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|