orgo 0.0.8__tar.gz → 0.0.10__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.8 → orgo-0.0.10}/PKG-INFO +1 -1
- {orgo-0.0.8 → orgo-0.0.10}/pyproject.toml +1 -1
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/api/client.py +3 -4
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/computer.py +4 -4
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo.egg-info/PKG-INFO +1 -1
- {orgo-0.0.8 → orgo-0.0.10}/README.md +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/setup.cfg +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/__init__.py +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/adapters/__init__.py +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/adapters/anthropic.py +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/adapters/base.py +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/adapters/openai.py +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/api/__init__.py +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/utils/__init__.py +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo/utils/auth.py +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo.egg-info/SOURCES.txt +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo.egg-info/dependency_links.txt +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo.egg-info/requires.txt +0 -0
- {orgo-0.0.8 → orgo-0.0.10}/src/orgo.egg-info/top_level.txt +0 -0
|
@@ -6,10 +6,9 @@ from typing import Dict, Any, Optional
|
|
|
6
6
|
from orgo.utils.auth import get_api_key
|
|
7
7
|
|
|
8
8
|
class ApiClient:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def __init__(self, api_key: Optional[str] = None):
|
|
9
|
+
def __init__(self, api_key: Optional[str] = None, base_url: Optional[str] = None):
|
|
12
10
|
self.api_key = get_api_key(api_key)
|
|
11
|
+
self.base_url = base_url or "https://www.orgo.ai/api"
|
|
13
12
|
self.session = requests.Session()
|
|
14
13
|
self.session.headers.update({
|
|
15
14
|
"Authorization": f"Bearer {self.api_key}",
|
|
@@ -18,7 +17,7 @@ class ApiClient:
|
|
|
18
17
|
})
|
|
19
18
|
|
|
20
19
|
def _request(self, method: str, endpoint: str, data: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
|
21
|
-
url = f"{self.
|
|
20
|
+
url = f"{self.base_url}/{endpoint}"
|
|
22
21
|
|
|
23
22
|
try:
|
|
24
23
|
if method.upper() == "GET":
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import os
|
|
4
4
|
import io
|
|
5
5
|
import base64
|
|
6
|
-
from typing import Dict, Any
|
|
6
|
+
from typing import Dict, Any, Optional
|
|
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=None, api_key=None, config=None):
|
|
13
|
-
self.api = ApiClient(api_key or os.environ.get("ORGO_API_KEY"))
|
|
12
|
+
def __init__(self, project_id=None, api_key=None, config=None, base_api_url=None):
|
|
13
|
+
self.api = ApiClient(api_key or os.environ.get("ORGO_API_KEY"), base_api_url)
|
|
14
14
|
|
|
15
15
|
if project_id:
|
|
16
16
|
self.project_id = project_id
|
|
@@ -71,7 +71,7 @@ class Computer:
|
|
|
71
71
|
def screenshot_base64(self) -> str:
|
|
72
72
|
"""Capture screenshot and return as base64 string"""
|
|
73
73
|
response = self.api.get_screenshot(self.project_id)
|
|
74
|
-
return response.get("
|
|
74
|
+
return response.get("image", "")
|
|
75
75
|
|
|
76
76
|
# Execution methods
|
|
77
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
|