meshagent-computers 0.0.32__tar.gz → 0.0.33__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.
Potentially problematic release.
This version of meshagent-computers might be problematic. Click here for more details.
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/CHANGELOG.md +3 -0
- {meshagent_computers-0.0.32/meshagent_computers.egg-info → meshagent_computers-0.0.33}/PKG-INFO +4 -4
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/agent.py +45 -25
- meshagent_computers-0.0.33/meshagent/computers/version.py +1 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33/meshagent_computers.egg-info}/PKG-INFO +4 -4
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent_computers.egg-info/requires.txt +3 -3
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/pyproject.toml +3 -3
- meshagent_computers-0.0.32/meshagent/computers/version.py +0 -1
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/LICENSE +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/MANIFEST.in +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/README.md +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/__init__.py +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/base_playwright.py +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/browserbase.py +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/computer.py +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/docker.py +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/local_playwright.py +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/operator.py +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/scrapybara.py +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/utils.py +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent_computers.egg-info/SOURCES.txt +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent_computers.egg-info/dependency_links.txt +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent_computers.egg-info/top_level.txt +0 -0
- {meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/setup.cfg +0 -0
{meshagent_computers-0.0.32/meshagent_computers.egg-info → meshagent_computers-0.0.33}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshagent-computers
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.33
|
|
4
4
|
Summary: Computer Building Blocks for Meshagent
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
Project-URL: Documentation, https://docs.meshagent.com
|
|
@@ -12,9 +12,9 @@ License-File: LICENSE
|
|
|
12
12
|
Requires-Dist: pytest~=8.3.5
|
|
13
13
|
Requires-Dist: pytest-asyncio~=0.26.0
|
|
14
14
|
Requires-Dist: openai~=1.86.0
|
|
15
|
-
Requires-Dist: meshagent-api~=0.0.
|
|
16
|
-
Requires-Dist: meshagent-agents~=0.0.
|
|
17
|
-
Requires-Dist: meshagent-tools~=0.0.
|
|
15
|
+
Requires-Dist: meshagent-api~=0.0.33
|
|
16
|
+
Requires-Dist: meshagent-agents~=0.0.33
|
|
17
|
+
Requires-Dist: meshagent-tools~=0.0.33
|
|
18
18
|
Requires-Dist: playwright~=1.51.0
|
|
19
19
|
Requires-Dist: browserbase~=1.2.0
|
|
20
20
|
Requires-Dist: scrapybara~=2.4.7
|
|
@@ -14,11 +14,30 @@ import logging
|
|
|
14
14
|
logger = logging.getLogger("computer")
|
|
15
15
|
logger.setLevel(logging.WARN)
|
|
16
16
|
|
|
17
|
+
class ComputerToolkit(Toolkit):
|
|
18
|
+
def __init__(self, name: str, computer:Computer, operator: Operator, tools: list[Tool]):
|
|
19
|
+
super().__init__(name=name, tools=tools)
|
|
20
|
+
self.computer = computer
|
|
21
|
+
self.operator = operator
|
|
22
|
+
self.started = False
|
|
23
|
+
self._starting = None
|
|
24
|
+
|
|
25
|
+
async def ensure_started(self):
|
|
26
|
+
|
|
27
|
+
self.started = False
|
|
28
|
+
|
|
29
|
+
if self.started == False:
|
|
30
|
+
|
|
31
|
+
self.started = True
|
|
32
|
+
await self.computer.__aenter__()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
17
36
|
def make_computer_toolkit(*, operator_cls: Type[Operator], computer_cls: Type[Computer], render_screen: Callable[[bytes],None]):
|
|
18
37
|
|
|
19
38
|
operator = operator_cls()
|
|
20
39
|
computer = computer_cls()
|
|
21
|
-
|
|
40
|
+
|
|
22
41
|
|
|
23
42
|
class ComputerTool(OpenAIResponsesTool):
|
|
24
43
|
def __init__(self, *, operator: Operator, computer: Computer, title = "computer_call", description = "handle computer calls from computer use preview", rules = [], thumbnail_url = None):
|
|
@@ -32,22 +51,23 @@ def make_computer_toolkit(*, operator_cls: Type[Operator], computer_cls: Type[Co
|
|
|
32
51
|
)
|
|
33
52
|
self.computer = computer
|
|
34
53
|
|
|
35
|
-
def
|
|
54
|
+
def get_open_ai_tool_definitions(self) -> list[dict]:
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
"type": "computer_use_preview",
|
|
58
|
+
"display_width": self.computer.dimensions[0],
|
|
59
|
+
"display_height": self.computer.dimensions[1],
|
|
60
|
+
"environment": self.computer.environment,
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
def get_open_ai_output_handlers(self):
|
|
36
65
|
return {
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
"display_height": self.computer.dimensions[1],
|
|
40
|
-
"environment": self.computer.environment,
|
|
41
|
-
}
|
|
66
|
+
"computer_call" : self.handle_computer_call
|
|
67
|
+
}
|
|
42
68
|
|
|
43
|
-
async def
|
|
69
|
+
async def handle_computer_call(self, context: ToolContext, **arguments):
|
|
44
70
|
|
|
45
|
-
nonlocal started
|
|
46
|
-
if started == False:
|
|
47
|
-
await self.computer.__aenter__()
|
|
48
|
-
started = True
|
|
49
|
-
|
|
50
|
-
|
|
51
71
|
outputs = await operator.play(computer=self.computer, item=arguments)
|
|
52
72
|
for output in outputs:
|
|
53
73
|
if output["type"] == "computer_call_output":
|
|
@@ -69,7 +89,7 @@ def make_computer_toolkit(*, operator_cls: Type[Operator], computer_cls: Type[Co
|
|
|
69
89
|
ScreenshotTool(computer=computer),
|
|
70
90
|
GotoURL(computer=computer),
|
|
71
91
|
])
|
|
72
|
-
return
|
|
92
|
+
return outputs[0]
|
|
73
93
|
|
|
74
94
|
class ScreenshotTool(Tool):
|
|
75
95
|
def __init__(self, computer: Computer):
|
|
@@ -97,11 +117,6 @@ def make_computer_toolkit(*, operator_cls: Type[Operator], computer_cls: Type[Co
|
|
|
97
117
|
|
|
98
118
|
|
|
99
119
|
async def execute(self, context: ToolContext, save_path: str, full_page: bool):
|
|
100
|
-
nonlocal started
|
|
101
|
-
if started == False:
|
|
102
|
-
await self.computer.__aenter__()
|
|
103
|
-
started = True
|
|
104
|
-
|
|
105
120
|
screenshot_bytes = await self.computer.screenshot_bytes(full_page=full_page)
|
|
106
121
|
handle = await context.room.storage.open(path=save_path, overwrite=True)
|
|
107
122
|
await context.room.storage.write(handle=handle, data=screenshot_bytes)
|
|
@@ -132,10 +147,7 @@ def make_computer_toolkit(*, operator_cls: Type[Operator], computer_cls: Type[Co
|
|
|
132
147
|
|
|
133
148
|
|
|
134
149
|
async def execute(self, context: ToolContext, url: str):
|
|
135
|
-
|
|
136
|
-
if started == False:
|
|
137
|
-
await self.computer.__aenter__()
|
|
138
|
-
started = True
|
|
150
|
+
|
|
139
151
|
|
|
140
152
|
if url.startswith("https://") == False and url.startswith("http://") == False:
|
|
141
153
|
url = "https://"+url
|
|
@@ -147,7 +159,7 @@ def make_computer_toolkit(*, operator_cls: Type[Operator], computer_cls: Type[Co
|
|
|
147
159
|
|
|
148
160
|
computer_tool = ComputerTool(computer=computer, operator=operator)
|
|
149
161
|
|
|
150
|
-
computer_toolkit =
|
|
162
|
+
computer_toolkit = ComputerToolkit(name="meshagent.openai.computer", computer=computer, operator=operator, tools=[
|
|
151
163
|
computer_tool
|
|
152
164
|
])
|
|
153
165
|
|
|
@@ -191,6 +203,8 @@ class ComputerAgent(ChatBot):
|
|
|
191
203
|
self.operator_cls = operator_cls
|
|
192
204
|
|
|
193
205
|
|
|
206
|
+
|
|
207
|
+
|
|
194
208
|
async def get_thread_toolkits(self, *, thread_context: ChatThreadContext, participant: RemoteParticipant):
|
|
195
209
|
|
|
196
210
|
toolkits = await super().get_thread_toolkits(thread_context=thread_context, participant=participant)
|
|
@@ -210,6 +224,12 @@ class ComputerAgent(ChatBot):
|
|
|
210
224
|
computer_cls=self.computer_cls,
|
|
211
225
|
render_screen=render_screen
|
|
212
226
|
)
|
|
227
|
+
|
|
228
|
+
await computer_toolkit.ensure_started()
|
|
229
|
+
|
|
230
|
+
await computer_toolkit.computer.goto("https://www.flutterconusa.dev/agenda")
|
|
231
|
+
|
|
232
|
+
|
|
213
233
|
return [
|
|
214
234
|
computer_toolkit,
|
|
215
235
|
*toolkits
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.33"
|
{meshagent_computers-0.0.32 → meshagent_computers-0.0.33/meshagent_computers.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshagent-computers
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.33
|
|
4
4
|
Summary: Computer Building Blocks for Meshagent
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
Project-URL: Documentation, https://docs.meshagent.com
|
|
@@ -12,9 +12,9 @@ License-File: LICENSE
|
|
|
12
12
|
Requires-Dist: pytest~=8.3.5
|
|
13
13
|
Requires-Dist: pytest-asyncio~=0.26.0
|
|
14
14
|
Requires-Dist: openai~=1.86.0
|
|
15
|
-
Requires-Dist: meshagent-api~=0.0.
|
|
16
|
-
Requires-Dist: meshagent-agents~=0.0.
|
|
17
|
-
Requires-Dist: meshagent-tools~=0.0.
|
|
15
|
+
Requires-Dist: meshagent-api~=0.0.33
|
|
16
|
+
Requires-Dist: meshagent-agents~=0.0.33
|
|
17
|
+
Requires-Dist: meshagent-tools~=0.0.33
|
|
18
18
|
Requires-Dist: playwright~=1.51.0
|
|
19
19
|
Requires-Dist: browserbase~=1.2.0
|
|
20
20
|
Requires-Dist: scrapybara~=2.4.7
|
{meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent_computers.egg-info/requires.txt
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
pytest~=8.3.5
|
|
2
2
|
pytest-asyncio~=0.26.0
|
|
3
3
|
openai~=1.86.0
|
|
4
|
-
meshagent-api~=0.0.
|
|
5
|
-
meshagent-agents~=0.0.
|
|
6
|
-
meshagent-tools~=0.0.
|
|
4
|
+
meshagent-api~=0.0.33
|
|
5
|
+
meshagent-agents~=0.0.33
|
|
6
|
+
meshagent-tools~=0.0.33
|
|
7
7
|
playwright~=1.51.0
|
|
8
8
|
browserbase~=1.2.0
|
|
9
9
|
scrapybara~=2.4.7
|
|
@@ -15,9 +15,9 @@ dependencies = [
|
|
|
15
15
|
"pytest~=8.3.5",
|
|
16
16
|
"pytest-asyncio~=0.26.0",
|
|
17
17
|
"openai~=1.86.0",
|
|
18
|
-
"meshagent-api~=0.0.
|
|
19
|
-
"meshagent-agents~=0.0.
|
|
20
|
-
"meshagent-tools~=0.0.
|
|
18
|
+
"meshagent-api~=0.0.33",
|
|
19
|
+
"meshagent-agents~=0.0.33",
|
|
20
|
+
"meshagent-tools~=0.0.33",
|
|
21
21
|
"playwright~=1.51.0",
|
|
22
22
|
"browserbase~=1.2.0",
|
|
23
23
|
"scrapybara~=2.4.7"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.32"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/base_playwright.py
RENAMED
|
File without changes
|
{meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/browserbase.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent/computers/local_playwright.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent_computers.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{meshagent_computers-0.0.32 → meshagent_computers-0.0.33}/meshagent_computers.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|