voxagent 0.2.1__py3-none-any.whl → 0.2.3__py3-none-any.whl
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.
voxagent/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.3"
|
|
2
2
|
__version_info__ = tuple(int(x) for x in __version__.split("."))
|
voxagent/code/agent.py
CHANGED
|
@@ -101,10 +101,15 @@ class CodeModeExecutor:
|
|
|
101
101
|
timeout_seconds=config.timeout_seconds,
|
|
102
102
|
memory_limit_mb=config.memory_limit_mb,
|
|
103
103
|
)
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
|
|
106
105
|
# Tool proxy for routing calls
|
|
107
106
|
self._tool_implementations: dict[str, Any] = {}
|
|
107
|
+
|
|
108
|
+
# Create virtual filesystem with call_tool support
|
|
109
|
+
self.virtual_fs = VirtualFilesystem(
|
|
110
|
+
registry=tool_registry,
|
|
111
|
+
tool_caller=self.call_tool,
|
|
112
|
+
)
|
|
108
113
|
|
|
109
114
|
def register_tool_implementation(
|
|
110
115
|
self,
|
|
@@ -127,9 +132,7 @@ class CodeModeExecutor:
|
|
|
127
132
|
Returns:
|
|
128
133
|
Captured output or error message
|
|
129
134
|
"""
|
|
130
|
-
# Build globals with virtual filesystem functions
|
|
131
|
-
# Note: call_tool is not passed to sandbox due to pickling constraints
|
|
132
|
-
# The LLM should use ls() and read() to explore, then describe what to call
|
|
135
|
+
# Build globals with virtual filesystem functions (ls, read, call_tool)
|
|
133
136
|
globals_dict = self.virtual_fs.get_sandbox_globals()
|
|
134
137
|
|
|
135
138
|
# Execute in sandbox
|
|
@@ -158,12 +161,34 @@ class CodeModeExecutor:
|
|
|
158
161
|
Returns:
|
|
159
162
|
Tool result or error message
|
|
160
163
|
"""
|
|
164
|
+
import asyncio
|
|
165
|
+
import inspect
|
|
166
|
+
|
|
161
167
|
key = f"{category}.{tool_name}"
|
|
162
168
|
if key not in self._tool_implementations:
|
|
163
169
|
return f"Error: Tool '{key}' not found"
|
|
164
170
|
try:
|
|
165
171
|
impl = self._tool_implementations[key]
|
|
166
|
-
|
|
172
|
+
result = impl(**kwargs)
|
|
173
|
+
|
|
174
|
+
# Handle async functions
|
|
175
|
+
if inspect.iscoroutine(result):
|
|
176
|
+
try:
|
|
177
|
+
loop = asyncio.get_running_loop()
|
|
178
|
+
except RuntimeError:
|
|
179
|
+
loop = None
|
|
180
|
+
|
|
181
|
+
if loop is not None:
|
|
182
|
+
# Already in an async context - create task
|
|
183
|
+
import concurrent.futures
|
|
184
|
+
with concurrent.futures.ThreadPoolExecutor() as executor:
|
|
185
|
+
future = executor.submit(asyncio.run, result)
|
|
186
|
+
return future.result()
|
|
187
|
+
else:
|
|
188
|
+
# Not in async context - run directly
|
|
189
|
+
return asyncio.run(result)
|
|
190
|
+
|
|
191
|
+
return result
|
|
167
192
|
except Exception as e:
|
|
168
193
|
return f"Error calling {key}: {e}"
|
|
169
194
|
|
voxagent/code/virtual_fs.py
CHANGED
|
@@ -95,11 +95,15 @@ class ToolRegistry:
|
|
|
95
95
|
return []
|
|
96
96
|
|
|
97
97
|
|
|
98
|
+
# Type alias for tool caller function
|
|
99
|
+
ToolCaller = Any # Callable[[str, str, ...], Any]
|
|
100
|
+
|
|
101
|
+
|
|
98
102
|
class VirtualFilesystem:
|
|
99
103
|
"""Virtual filesystem for tool discovery.
|
|
100
|
-
|
|
104
|
+
|
|
101
105
|
Provides ls() and read() functions that can be injected into the sandbox.
|
|
102
|
-
|
|
106
|
+
|
|
103
107
|
Directory structure:
|
|
104
108
|
tools/
|
|
105
109
|
├── __index__.md
|
|
@@ -111,9 +115,14 @@ class VirtualFilesystem:
|
|
|
111
115
|
├── __index__.md
|
|
112
116
|
└── temperature.py
|
|
113
117
|
"""
|
|
114
|
-
|
|
115
|
-
def __init__(
|
|
118
|
+
|
|
119
|
+
def __init__(
|
|
120
|
+
self,
|
|
121
|
+
registry: ToolRegistry,
|
|
122
|
+
tool_caller: ToolCaller | None = None,
|
|
123
|
+
) -> None:
|
|
116
124
|
self._registry = registry
|
|
125
|
+
self._tool_caller = tool_caller
|
|
117
126
|
|
|
118
127
|
def ls(self, path: str) -> list[str]:
|
|
119
128
|
"""List directory contents.
|
|
@@ -212,12 +221,17 @@ class VirtualFilesystem:
|
|
|
212
221
|
|
|
213
222
|
def get_sandbox_globals(self) -> dict[str, Any]:
|
|
214
223
|
"""Get globals dict to inject into sandbox.
|
|
215
|
-
|
|
224
|
+
|
|
216
225
|
Returns:
|
|
217
|
-
Dict with ls and
|
|
226
|
+
Dict with ls, read, and call_tool functions bound to this filesystem
|
|
218
227
|
"""
|
|
219
|
-
|
|
228
|
+
globals_dict: dict[str, Any] = {
|
|
220
229
|
"ls": self.ls,
|
|
221
230
|
"read": self.read,
|
|
222
231
|
}
|
|
223
232
|
|
|
233
|
+
if self._tool_caller is not None:
|
|
234
|
+
globals_dict["call_tool"] = self._tool_caller
|
|
235
|
+
|
|
236
|
+
return globals_dict
|
|
237
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: voxagent
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: A lightweight, model-agnostic LLM provider abstraction with streaming and tool support
|
|
5
5
|
Project-URL: Homepage, https://github.com/lensator/voxagent
|
|
6
6
|
Project-URL: Documentation, https://github.com/lensator/voxagent#readme
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
voxagent/__init__.py,sha256=YMYC95iwWXK26hicGYmd2erNOInrYtohwUVOuNmpTCs,3927
|
|
2
|
-
voxagent/_version.py,sha256=
|
|
2
|
+
voxagent/_version.py,sha256=avoaFz2ddynhpdQn-udgPxrhqWOcXWc2liIjyh_vgkI,87
|
|
3
3
|
voxagent/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
4
4
|
voxagent/agent/__init__.py,sha256=eASoU7Zhvw8BtJ-iUqVN06S4fMLkHwDgUZbHeH2AUOM,755
|
|
5
5
|
voxagent/agent/abort.py,sha256=2Wnnxq8Dcn7wQkKPHrba2o0OeOdzF4NNsl-usgE4CJw,5191
|
|
6
6
|
voxagent/agent/core.py,sha256=zXDUubx6oWQCj1V997s2zJ0Xj0XCaWIPZNinTNMz2zY,30581
|
|
7
7
|
voxagent/code/__init__.py,sha256=MzbrYReislAB-lCZEZn_lBEPGjYZyPK-c9RFCq1nSm0,1379
|
|
8
|
-
voxagent/code/agent.py,sha256=
|
|
8
|
+
voxagent/code/agent.py,sha256=fVaOlJNvnHJedPCCW5Rmm4_-YRvgcYpaLicXA-8HWxU,9634
|
|
9
9
|
voxagent/code/sandbox.py,sha256=LP2cwXchDk6mtiYGRb_RmkGNoyPv5OEKQC2h4M89dC0,11669
|
|
10
10
|
voxagent/code/tool_proxy.py,sha256=wZvRqXoz2SfYTHLpe8tIkpJL6b8fmlU96DSGeYw-HfM,8091
|
|
11
|
-
voxagent/code/virtual_fs.py,sha256=
|
|
11
|
+
voxagent/code/virtual_fs.py,sha256=wgkH7voirgDEeD2xg0yaOxU08qWwF-iqXEWy94n0I5U,7435
|
|
12
12
|
voxagent/mcp/__init__.py,sha256=_3Rsn7nIuivdWLv0MzpyjRGsPuCgr4LrXCge6FCb3nE,470
|
|
13
13
|
voxagent/mcp/manager.py,sha256=sECOhw-f6HB6NV-mBqcgJzsEt28acdQI_O2cT-41Rxw,6606
|
|
14
14
|
voxagent/mcp/tool.py,sha256=YQQqXNcanDDr5tkL1Z5OjNsDI5dWMEzm_SlJ4pOcUpk,5147
|
|
@@ -52,6 +52,6 @@ voxagent/tools/registry.py,sha256=MNJzgcmKT0AoMWIky9TJY4WVhzn5dkmjIHsUiZ3mv3U,25
|
|
|
52
52
|
voxagent/types/__init__.py,sha256=3VunuprKKEpOR9Cg-UITHJXds_xQ-tfqQb4S7wD3nP4,933
|
|
53
53
|
voxagent/types/messages.py,sha256=c6hNi9w6C8gbFoFm5fFge35vwJGywaoR_OiPQprfyVs,3494
|
|
54
54
|
voxagent/types/run.py,sha256=4vYq0pCqH7_7SWbMb1SplWj4TLiE3DELDYMi0HefFmo,5071
|
|
55
|
-
voxagent-0.2.
|
|
56
|
-
voxagent-0.2.
|
|
57
|
-
voxagent-0.2.
|
|
55
|
+
voxagent-0.2.3.dist-info/METADATA,sha256=lxBJ9wIDJhCCLGb4P_ps9C0d5kfYVdTAHZNyDer9vYU,5685
|
|
56
|
+
voxagent-0.2.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
57
|
+
voxagent-0.2.3.dist-info/RECORD,,
|
|
File without changes
|