orgo 0.0.31__tar.gz → 0.0.32__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.31 → orgo-0.0.32}/PKG-INFO +1 -1
- {orgo-0.0.31 → orgo-0.0.32}/pyproject.toml +1 -1
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo/computer.py +11 -18
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo.egg-info/PKG-INFO +1 -1
- {orgo-0.0.31 → orgo-0.0.32}/README.md +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/setup.cfg +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo/__init__.py +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo/api/__init__.py +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo/api/client.py +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo/project.py +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo/prompt.py +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo/utils/__init__.py +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo/utils/auth.py +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo.egg-info/SOURCES.txt +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo.egg-info/dependency_links.txt +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo.egg-info/requires.txt +0 -0
- {orgo-0.0.31 → orgo-0.0.32}/src/orgo.egg-info/top_level.txt +0 -0
|
@@ -47,8 +47,8 @@ class Computer:
|
|
|
47
47
|
# Create computer in existing project
|
|
48
48
|
computer = Computer(project="manus", ram=4, cpu=2)
|
|
49
49
|
|
|
50
|
-
# Connect to existing computer
|
|
51
|
-
computer = Computer(
|
|
50
|
+
# Connect to existing computer by ID
|
|
51
|
+
computer = Computer(computer_id="11c4fd46-e069-4c32-be65-f82d9f87b9b8")
|
|
52
52
|
"""
|
|
53
53
|
self.api_key = api_key or operating_system.environ.get("ORGO_API_KEY")
|
|
54
54
|
self.base_api_url = base_api_url
|
|
@@ -65,8 +65,12 @@ class Computer:
|
|
|
65
65
|
self.gpu = gpu or "none"
|
|
66
66
|
|
|
67
67
|
if computer_id:
|
|
68
|
-
#
|
|
69
|
-
self.
|
|
68
|
+
# Just store the computer ID, no API call needed
|
|
69
|
+
self.computer_id = computer_id
|
|
70
|
+
self.name = name
|
|
71
|
+
self.project_id = None
|
|
72
|
+
self.project_name = None
|
|
73
|
+
logger.info(f"Connected to computer ID: {self.computer_id}")
|
|
70
74
|
elif project:
|
|
71
75
|
# Work with specified project
|
|
72
76
|
if isinstance(project, str):
|
|
@@ -86,17 +90,6 @@ class Computer:
|
|
|
86
90
|
# No project specified, create a new one
|
|
87
91
|
self._create_new_project_and_computer(name)
|
|
88
92
|
|
|
89
|
-
def _connect_by_id(self, computer_id: str):
|
|
90
|
-
"""Connect to existing computer by ID"""
|
|
91
|
-
self.computer_id = computer_id
|
|
92
|
-
self._info = self.api.get_computer(computer_id)
|
|
93
|
-
self.project_id = self._info.get("project_id")
|
|
94
|
-
self.name = self._info.get("name")
|
|
95
|
-
# Get project name
|
|
96
|
-
if self.project_id:
|
|
97
|
-
project = self.api.get_project(self.project_id)
|
|
98
|
-
self.project_name = project.get("name")
|
|
99
|
-
|
|
100
93
|
def _initialize_with_project_name(self, project_name: str, computer_name: Optional[str]):
|
|
101
94
|
"""Initialize with a project name (create project if needed)"""
|
|
102
95
|
try:
|
|
@@ -165,7 +158,6 @@ class Computer:
|
|
|
165
158
|
"""Connect to an existing computer"""
|
|
166
159
|
self.computer_id = computer_info.get("id")
|
|
167
160
|
self.name = computer_info.get("name")
|
|
168
|
-
self._info = computer_info
|
|
169
161
|
logger.info(f"Connected to existing computer {self.name} (ID: {self.computer_id})")
|
|
170
162
|
|
|
171
163
|
def _create_computer(self, project_id: str, computer_name: Optional[str]):
|
|
@@ -195,7 +187,6 @@ class Computer:
|
|
|
195
187
|
gpu=self.gpu
|
|
196
188
|
)
|
|
197
189
|
self.computer_id = computer.get("id")
|
|
198
|
-
self._info = computer
|
|
199
190
|
logger.info(f"Created new computer {self.name} (ID: {self.computer_id})")
|
|
200
191
|
|
|
201
192
|
def status(self) -> Dict[str, Any]:
|
|
@@ -330,4 +321,6 @@ class Computer:
|
|
|
330
321
|
)
|
|
331
322
|
|
|
332
323
|
def __repr__(self):
|
|
333
|
-
|
|
324
|
+
project_str = f", project='{self.project_name}'" if hasattr(self, 'project_name') and self.project_name else ""
|
|
325
|
+
name_str = f"name='{self.name}'" if hasattr(self, 'name') and self.name else f"id='{self.computer_id}'"
|
|
326
|
+
return f"Computer({name_str}{project_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
|