vision-agent 0.2.133__py3-none-any.whl → 0.2.134__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vision_agent/utils/execute.py +16 -1
- {vision_agent-0.2.133.dist-info → vision_agent-0.2.134.dist-info}/METADATA +1 -1
- {vision_agent-0.2.133.dist-info → vision_agent-0.2.134.dist-info}/RECORD +5 -5
- {vision_agent-0.2.133.dist-info → vision_agent-0.2.134.dist-info}/LICENSE +0 -0
- {vision_agent-0.2.133.dist-info → vision_agent-0.2.134.dist-info}/WHEEL +0 -0
vision_agent/utils/execute.py
CHANGED
@@ -691,8 +691,9 @@ class CodeInterpreterFactory:
|
|
691
691
|
if not code_sandbox_runtime:
|
692
692
|
code_sandbox_runtime = os.getenv("CODE_SANDBOX_RUNTIME", "local")
|
693
693
|
if code_sandbox_runtime == "e2b":
|
694
|
+
envs = _get_e2b_env()
|
694
695
|
instance: CodeInterpreter = E2BCodeInterpreter(
|
695
|
-
timeout=_SESSION_TIMEOUT, remote_path=remote_path
|
696
|
+
timeout=_SESSION_TIMEOUT, remote_path=remote_path, envs=envs
|
696
697
|
)
|
697
698
|
elif code_sandbox_runtime == "local":
|
698
699
|
instance = LocalCodeInterpreter(
|
@@ -705,6 +706,20 @@ class CodeInterpreterFactory:
|
|
705
706
|
return instance
|
706
707
|
|
707
708
|
|
709
|
+
def _get_e2b_env() -> Union[Dict[str, str], None]:
|
710
|
+
openai_api_key = os.getenv("OPENAI_API_KEY", "")
|
711
|
+
anthropic_api_key = os.getenv("ANTHROPIC_API_KEY", "")
|
712
|
+
if openai_api_key or anthropic_api_key:
|
713
|
+
envs = {}
|
714
|
+
if openai_api_key:
|
715
|
+
envs["OPENAI_API_KEY"] = openai_api_key
|
716
|
+
if anthropic_api_key:
|
717
|
+
envs["ANTHROPIC_API_KEY"] = anthropic_api_key
|
718
|
+
else:
|
719
|
+
envs = None
|
720
|
+
return envs
|
721
|
+
|
722
|
+
|
708
723
|
def _parse_local_code_interpreter_outputs(outputs: List[Dict[str, Any]]) -> Execution:
|
709
724
|
"""Parse notebook cell outputs to Execution object. Output types:
|
710
725
|
https://nbformat.readthedocs.io/en/latest/format_description.html#code-cell-outputs
|
@@ -22,12 +22,12 @@ vision_agent/tools/tools.py,sha256=WKeB99ED0o_ISS_vZc-ch_1Dc8_Fl2fhnGlfVNwNouc,7
|
|
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=BZ114WuP5oVk45E_uvUkCwYX-nmVQdNgBvhH3GegUnM,27748
|
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=hOjfEOZNcddYdoa0CoviXA4Vo9kwURKuojIJgLLJdp0,4745
|
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.134.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
31
|
+
vision_agent-0.2.134.dist-info/METADATA,sha256=nGDpQtIHLCuDkIo4Is_YfgtLhNNPT3_Os35lGn0UyoQ,12252
|
32
|
+
vision_agent-0.2.134.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
33
|
+
vision_agent-0.2.134.dist-info/RECORD,,
|
File without changes
|
File without changes
|