vision-agent 0.2.128__py3-none-any.whl → 0.2.130__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vision_agent/tools/tool_utils.py +6 -0
- vision_agent/utils/execute.py +3 -0
- {vision_agent-0.2.128.dist-info → vision_agent-0.2.130.dist-info}/METADATA +1 -1
- {vision_agent-0.2.128.dist-info → vision_agent-0.2.130.dist-info}/RECORD +6 -6
- {vision_agent-0.2.128.dist-info → vision_agent-0.2.130.dist-info}/LICENSE +0 -0
- {vision_agent-0.2.128.dist-info → vision_agent-0.2.130.dist-info}/WHEEL +0 -0
vision_agent/tools/tool_utils.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
from base64 import b64encode
|
1
2
|
import inspect
|
2
3
|
import logging
|
3
4
|
import os
|
@@ -27,6 +28,7 @@ class ToolCallTrace(BaseModel):
|
|
27
28
|
request: MutableMapping[str, Any]
|
28
29
|
response: MutableMapping[str, Any]
|
29
30
|
error: Optional[Error]
|
31
|
+
files: Optional[List[tuple[str, str]]]
|
30
32
|
|
31
33
|
|
32
34
|
def send_inference_request(
|
@@ -202,12 +204,16 @@ def _call_post(
|
|
202
204
|
files: Optional[List[Tuple[Any, ...]]] = None,
|
203
205
|
function_name: str = "unknown",
|
204
206
|
) -> Any:
|
207
|
+
files_in_b64 = None
|
208
|
+
if files:
|
209
|
+
files_in_b64 = [(file[0], b64encode(file[1]).decode("utf-8")) for file in files]
|
205
210
|
try:
|
206
211
|
tool_call_trace = ToolCallTrace(
|
207
212
|
endpoint_url=url,
|
208
213
|
request=payload,
|
209
214
|
response={},
|
210
215
|
error=None,
|
216
|
+
files=files_in_b64,
|
211
217
|
)
|
212
218
|
|
213
219
|
if files is not None:
|
vision_agent/utils/execute.py
CHANGED
@@ -243,6 +243,9 @@ class Logs(BaseModel):
|
|
243
243
|
f"----- stdout -----\n{stdout_str}\n----- stderr -----\n{stderr_str}"
|
244
244
|
)
|
245
245
|
|
246
|
+
def to_json(self) -> dict[str, list[str]]:
|
247
|
+
return {"stdout": self.stdout, "stderr": self.stderr}
|
248
|
+
|
246
249
|
|
247
250
|
class Error(BaseModel):
|
248
251
|
"""Represents an error that occurred during the execution of a cell. The error
|
@@ -17,17 +17,17 @@ vision_agent/lmm/types.py,sha256=ZEXR_ptBL0ZwDMTDYkgxUCmSZFmBYPQd2jreNzr_8UY,221
|
|
17
17
|
vision_agent/tools/__init__.py,sha256=nx60_hujcnLz3d2wQlCbcerUmT6R2vxRy66IsQjdB3M,2364
|
18
18
|
vision_agent/tools/meta_tools.py,sha256=KeGiw2OtY8ARpGbtWjoNAoO1dwevt7LbCupaJX61MkE,18929
|
19
19
|
vision_agent/tools/prompts.py,sha256=V1z4YJLXZuUl_iZ5rY0M5hHc_2tmMEUKr0WocXKGt4E,1430
|
20
|
-
vision_agent/tools/tool_utils.py,sha256=
|
20
|
+
vision_agent/tools/tool_utils.py,sha256=PjdataKjPpiFSq1QBAAWHJUGPPn4p4dr07TPSlhXvFk,7758
|
21
21
|
vision_agent/tools/tools.py,sha256=p6QUo7V03UZOKBAGfabVWdPm9vUT9tyP_utCv0yKfcY,68659
|
22
22
|
vision_agent/tools/tools_types.py,sha256=rLpCUODPY0yI65SLOTJOxfHFfqWM3WjOq-AYX25Chjk,2356
|
23
23
|
vision_agent/utils/__init__.py,sha256=7fMgbZiEwbNS0fBOS_hJI5PuEYBblw36zLi_UjUzvj4,244
|
24
24
|
vision_agent/utils/exceptions.py,sha256=booSPSuoULF7OXRr_YbC4dtKt6gM_HyiFQHBuaW86C4,2052
|
25
|
-
vision_agent/utils/execute.py,sha256=
|
25
|
+
vision_agent/utils/execute.py,sha256=uIAupmUtesUvhCQJ8oeGxDeX7SYDz0TLxFhPB4HD2NA,27147
|
26
26
|
vision_agent/utils/image_utils.py,sha256=zTTOJFOieMzwIquTFnW7T6ssx9o6XfoZ0Unqyk7GJrg,10746
|
27
27
|
vision_agent/utils/sim.py,sha256=ebE9Cs00pVEDI1HMjAzUBk88tQQmc2U-yAzIDinnekU,5572
|
28
28
|
vision_agent/utils/type_defs.py,sha256=BE12s3JNQy36QvauXHjwyeffVh5enfcvd4vTzSwvEZI,1384
|
29
29
|
vision_agent/utils/video.py,sha256=GmJqu_3WhBMEwP4HToMMp8EwgftliHSpv5nd-QEDOcs,4528
|
30
|
-
vision_agent-0.2.
|
31
|
-
vision_agent-0.2.
|
32
|
-
vision_agent-0.2.
|
33
|
-
vision_agent-0.2.
|
30
|
+
vision_agent-0.2.130.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
31
|
+
vision_agent-0.2.130.dist-info/METADATA,sha256=kShllthjgQ1tk4r3gT6Rr1lmYV3ovcaWmtybhUY42Zk,12295
|
32
|
+
vision_agent-0.2.130.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
33
|
+
vision_agent-0.2.130.dist-info/RECORD,,
|
File without changes
|
File without changes
|