vision-agent 1.0.2__tar.gz → 1.0.3__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.
Files changed (53) hide show
  1. {vision_agent-1.0.2 → vision_agent-1.0.3}/PKG-INFO +2 -4
  2. {vision_agent-1.0.2 → vision_agent-1.0.3}/pyproject.toml +2 -6
  3. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent.py +3 -3
  4. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_coder.py +1 -1
  5. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_coder_v2.py +1 -1
  6. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_planner_v2.py +1 -1
  7. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_v2.py +1 -1
  8. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/utils/execute.py +2 -204
  9. {vision_agent-1.0.2 → vision_agent-1.0.3}/LICENSE +0 -0
  10. {vision_agent-1.0.2 → vision_agent-1.0.3}/README.md +0 -0
  11. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/.sim_tools/df.csv +0 -0
  12. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/.sim_tools/embs.npy +0 -0
  13. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/__init__.py +0 -0
  14. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/README.md +0 -0
  15. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/__init__.py +0 -0
  16. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/agent.py +0 -0
  17. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_coder_prompts.py +0 -0
  18. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_coder_prompts_v2.py +0 -0
  19. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_planner.py +0 -0
  20. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_planner_prompts.py +0 -0
  21. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_planner_prompts_v2.py +0 -0
  22. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_prompts.py +0 -0
  23. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/agent/vision_agent_prompts_v2.py +0 -0
  24. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/clients/__init__.py +0 -0
  25. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/clients/http.py +0 -0
  26. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/configs/__init__.py +0 -0
  27. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/configs/anthropic_config.py +0 -0
  28. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/configs/anthropic_openai_config.py +0 -0
  29. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/configs/config.py +0 -0
  30. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/configs/openai_config.py +0 -0
  31. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/fonts/__init__.py +0 -0
  32. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/fonts/default_font_ch_en.ttf +0 -0
  33. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/lmm/__init__.py +0 -0
  34. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/lmm/lmm.py +0 -0
  35. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/models/__init__.py +0 -0
  36. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/models/agent_types.py +0 -0
  37. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/models/lmm_types.py +0 -0
  38. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/models/tools_types.py +0 -0
  39. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/sim/__init__.py +0 -0
  40. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/sim/sim.py +0 -0
  41. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/tools/__init__.py +0 -0
  42. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/tools/meta_tools.py +0 -0
  43. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/tools/planner_tools.py +0 -0
  44. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/tools/prompts.py +0 -0
  45. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/tools/tools.py +0 -0
  46. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/utils/__init__.py +0 -0
  47. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/utils/agent.py +0 -0
  48. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/utils/exceptions.py +0 -0
  49. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/utils/image_utils.py +0 -0
  50. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/utils/tools.py +0 -0
  51. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/utils/tools_doc.py +0 -0
  52. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/utils/video.py +0 -0
  53. {vision_agent-1.0.2 → vision_agent-1.0.3}/vision_agent/utils/video_tracking.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vision-agent
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Toolset for Vision Agent
5
5
  Author: Landing AI
6
6
  Author-email: dev@landing.ai
@@ -12,8 +12,6 @@ Classifier: Programming Language :: Python :: 3.11
12
12
  Requires-Dist: anthropic (>=0.31.0,<0.32.0)
13
13
  Requires-Dist: av (>=11.0.0,<12.0.0)
14
14
  Requires-Dist: dotenv (>=0.9.9,<0.10.0)
15
- Requires-Dist: e2b (>=0.17.2a50,<0.18.0)
16
- Requires-Dist: e2b-code-interpreter (==0.0.11a37)
17
15
  Requires-Dist: flake8 (>=7.0.0,<8.0.0)
18
16
  Requires-Dist: ipykernel (>=6.29.4,<7.0.0)
19
17
  Requires-Dist: libcst (>=1.5.0,<2.0.0)
@@ -27,7 +25,7 @@ Requires-Dist: opentelemetry-api (>=1.29.0,<2.0.0)
27
25
  Requires-Dist: pandas (>=2.0.0,<3.0.0)
28
26
  Requires-Dist: pillow (>=10.0.0,<11.0.0)
29
27
  Requires-Dist: pillow-heif (>=0.16.0,<0.17.0)
30
- Requires-Dist: pydantic (==2.7.4)
28
+ Requires-Dist: pydantic (>=2.0.0,<3.0.0)
31
29
  Requires-Dist: pytube (==15.0.0)
32
30
  Requires-Dist: requests (>=2.0.0,<3.0.0)
33
31
  Requires-Dist: rich (>=13.7.1,<14.0.0)
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "vision-agent"
7
- version = "1.0.2"
7
+ version = "1.0.3"
8
8
  description = "Toolset for Vision Agent"
9
9
  authors = ["Landing AI <dev@landing.ai>"]
10
10
  readme = "README.md"
@@ -34,13 +34,11 @@ nbclient = "^0.10.0"
34
34
  nbformat = "^5.10.4"
35
35
  rich = "^13.7.1"
36
36
  ipykernel = "^6.29.4"
37
- e2b = "^0.17.2a50"
38
- e2b-code-interpreter = "0.0.11a37"
39
37
  tenacity = "^8.3.0"
40
38
  pillow-heif = "^0.16.0"
41
39
  pytube = "15.0.0"
42
40
  anthropic = "^0.31.0"
43
- pydantic = "2.7.4"
41
+ pydantic = "^2.0.0"
44
42
  av = "^11.0.0"
45
43
  libcst = "^1.5.0"
46
44
  matplotlib = "^3.9.2"
@@ -106,6 +104,4 @@ module = [
106
104
  "cv2.*",
107
105
  "openai.*",
108
106
  "sentence_transformers.*",
109
- "e2b_code_interpreter.*",
110
- "e2b.*"
111
107
  ]
@@ -293,7 +293,7 @@ class VisionAgent(Agent):
293
293
  callback_message (Optional[Callable[[Dict[str, Any]], None]]): Callback
294
294
  function to send intermediate update messages.
295
295
  code_sandbox_runtime (Optional[str]): For string values it can be one of:
296
- None, "local" or "e2b". If None, it will read from the environment
296
+ None or "local". If None, it will read from the environment
297
297
  variable "CODE_SANDBOX_RUNTIME".
298
298
  """
299
299
 
@@ -560,7 +560,7 @@ class OpenAIVisionAgent(VisionAgent):
560
560
  callback_message (Optional[Callable[[Dict[str, Any]], None]]): Callback
561
561
  function to send intermediate update messages.
562
562
  code_interpreter (Optional[Union[str, CodeInterpreter]]): For string values
563
- it can be one of: None, "local" or "e2b". If None, it will read from
563
+ it can be one of: None or "local". If None, it will read from
564
564
  the environment variable "CODE_SANDBOX_RUNTIME". If a CodeInterpreter
565
565
  object is provided it will use that.
566
566
  """
@@ -591,7 +591,7 @@ class AnthropicVisionAgent(VisionAgent):
591
591
  callback_message (Optional[Callable[[Dict[str, Any]], None]]): Callback
592
592
  function to send intermediate update messages.
593
593
  code_interpreter (Optional[Union[str, CodeInterpreter]]): For string values
594
- it can be one of: None, "local" or "e2b". If None, it will read from
594
+ it can be one of: None or "local". If None, it will read from
595
595
  the environment variable "CODE_SANDBOX_RUNTIME". If a CodeInterpreter
596
596
  object is provided it will use that.
597
597
  """
@@ -349,7 +349,7 @@ class VisionAgentCoder(Agent):
349
349
  running in parallel. This callback ensures that the progress are not
350
350
  mixed up.
351
351
  code_interpreter (Optional[Union[str, CodeInterpreter]]): For string values
352
- it can be one of: None, "local" or "e2b". If None, it will read from
352
+ it can be one of: None or "local". If None, it will read from
353
353
  the environment variable "CODE_SANDBOX_RUNTIME". If a CodeInterpreter
354
354
  object is provided it will use that.
355
355
  """
@@ -317,7 +317,7 @@ class VisionAgentCoderV2(AgentCoder):
317
317
  hil (bool): Whether to use human-in-the-loop mode.
318
318
  verbose (bool): Whether to print out debug information.
319
319
  code_sandbox_runtime (Optional[str]): The code sandbox runtime to use, can
320
- be one of: None, "local" or "e2b". If None, it will read from the
320
+ be one of: None or "local". If None, it will read from the
321
321
  environment variable CODE_SANDBOX_RUNTIME.
322
322
  update_callback (Callable[[Dict[str, Any]], None]): The callback function
323
323
  that will send back intermediate conversation messages.
@@ -442,7 +442,7 @@ class VisionAgentPlannerV2(AgentPlanner):
442
442
  hil (bool): Whether to use human-in-the-loop mode.
443
443
  verbose (bool): Whether to print out debug information.
444
444
  code_sandbox_runtime (Optional[str]): The code sandbox runtime to use, can
445
- be one of: None, "local" or "e2b". If None, it will read from the
445
+ be one of: None or "local". If None, it will read from the
446
446
  environment variable CODE_SANDBOX_RUNTIME.
447
447
  update_callback (Callable[[Dict[str, Any]], None]): The callback function
448
448
  that will send back intermediate conversation messages.
@@ -180,7 +180,7 @@ class VisionAgentV2(Agent):
180
180
  hil (bool): Whether to use human-in-the-loop mode.
181
181
  verbose (bool): Whether to print out debug information.
182
182
  code_sandbox_runtime (Optional[str]): The code sandbox runtime to use, can
183
- be one of: None, "local" or "e2b". If None, it will read from the
183
+ be one of: None or "local". If None, it will read from the
184
184
  environment variable CODE_SANDBOX_RUNTIME.
185
185
  update_callback (Callable[[Dict[str, Any]], None]): The callback function
186
186
  that will send back intermediate conversation messages.
@@ -13,16 +13,7 @@ from time import sleep
13
13
  from typing import Any, Dict, Iterable, List, Optional, Union
14
14
 
15
15
  import nbformat
16
- import tenacity
17
16
  from dotenv import load_dotenv
18
- from e2b.exceptions import SandboxException
19
- from e2b_code_interpreter import CodeInterpreter as E2BCodeInterpreterImpl
20
- from e2b_code_interpreter import Execution as E2BExecution
21
- from e2b_code_interpreter import Result as E2BResult
22
- from h11._util import LocalProtocolError
23
- from httpx import ConnectError
24
- from httpx import RemoteProtocolError as HttpcoreRemoteProtocolError
25
- from httpx import RemoteProtocolError as HttpxRemoteProtocolError
26
17
  from nbclient import NotebookClient
27
18
  from nbclient import __version__ as nbclient_version
28
19
  from nbclient.exceptions import CellTimeoutError, DeadKernelError
@@ -33,11 +24,6 @@ from opentelemetry.trace import SpanKind, Status, StatusCode, get_tracer
33
24
  from pydantic import BaseModel, field_serializer
34
25
  from typing_extensions import Self
35
26
 
36
- from vision_agent.utils.exceptions import (
37
- RemoteSandboxCreationError,
38
- RemoteSandboxExecutionError,
39
- )
40
-
41
27
  load_dotenv()
42
28
  _LOGGER = logging.getLogger(__name__)
43
29
  _SESSION_TIMEOUT = 600 # 10 minutes
@@ -215,23 +201,6 @@ class Result:
215
201
  formats.extend(iter(self.extra))
216
202
  return formats
217
203
 
218
- @staticmethod
219
- def from_e2b_result(result: E2BResult) -> "Result":
220
- """
221
- Creates a Result object from an E2BResult object.
222
- """
223
- data = {
224
- MimeType.TEXT_PLAIN.value: result.text,
225
- MimeType.IMAGE_PNG.value: result.png,
226
- MimeType.APPLICATION_JSON.value: result.json,
227
- }
228
- for k, v in result.extra.items():
229
- data[k] = v
230
- return Result(
231
- is_main_result=result.is_main_result,
232
- data=data,
233
- )
234
-
235
204
 
236
205
  class Logs(BaseModel):
237
206
  """Data printed to stdout and stderr during execution, usually by print statements,
@@ -372,26 +341,6 @@ class Execution(BaseModel):
372
341
  )
373
342
  )
374
343
 
375
- @staticmethod
376
- def from_e2b_execution(exec: E2BExecution) -> "Execution":
377
- """Creates an Execution object from an E2BResult object."""
378
- return Execution(
379
- results=[Result.from_e2b_result(res) for res in exec.results],
380
- logs=Logs(stdout=exec.logs.stdout, stderr=exec.logs.stderr),
381
- error=(
382
- Error(
383
- name=exec.error.name,
384
- value=_remove_escape_and_color_codes(exec.error.value),
385
- traceback_raw=[
386
- _remove_escape_and_color_codes(line)
387
- for line in exec.error.traceback.split("\n")
388
- ],
389
- )
390
- if exec.error
391
- else None
392
- ),
393
- )
394
-
395
344
 
396
345
  class CodeInterpreter(abc.ABC):
397
346
  """Code interpreter interface."""
@@ -439,138 +388,6 @@ class CodeInterpreter(abc.ABC):
439
388
  return Path(local_file_path)
440
389
 
441
390
 
442
- class E2BCodeInterpreter(CodeInterpreter):
443
- def __init__(
444
- self, remote_path: Optional[Union[str, Path]] = None, *args: Any, **kwargs: Any
445
- ) -> None:
446
- super().__init__(*args, **kwargs)
447
- assert os.getenv("E2B_API_KEY"), "E2B_API_KEY environment variable must be set"
448
- try:
449
- self.interpreter = E2BCodeInterpreter._new_e2b_interpreter_impl(
450
- *args, **kwargs
451
- )
452
- except Exception as e:
453
- raise RemoteSandboxCreationError(
454
- f"Failed to create a remote sandbox due to {e}"
455
- ) from e
456
-
457
- result = self.exec_cell(
458
- """
459
- import platform
460
- import sys
461
- import importlib.metadata
462
-
463
- print(f"Python version: {sys.version}")
464
- print(f"OS version: {platform.system()} {platform.release()} ({platform.architecture()})")
465
- va_version = importlib.metadata.version("vision-agent")
466
- print(f"Vision Agent version: {va_version}")"""
467
- )
468
- sys_versions = "\n".join(result.logs.stdout)
469
- _LOGGER.info(
470
- f"E2BCodeInterpreter (sandbox id: {self.interpreter.sandbox_id}) initialized:\n{sys_versions}"
471
- )
472
- self.remote_path = Path(
473
- remote_path if remote_path is not None else "/home/user"
474
- )
475
-
476
- def close(self, *args: Any, **kwargs: Any) -> None:
477
- try:
478
- self.interpreter.kill(request_timeout=2)
479
- _LOGGER.info(
480
- f"The sandbox {self.interpreter.sandbox_id} is closed successfully."
481
- )
482
- except Exception as e:
483
- _LOGGER.warn(
484
- f"Failed to close the remote sandbox ({self.interpreter.sandbox_id}) due to {e}. This is not an issue. It's likely that the sandbox is already closed due to timeout."
485
- )
486
-
487
- def restart_kernel(self) -> None:
488
- self.interpreter.notebook.restart_kernel()
489
-
490
- @tenacity.retry(
491
- wait=tenacity.wait_exponential_jitter(),
492
- stop=tenacity.stop_after_attempt(3),
493
- retry=tenacity.retry_if_exception_type(
494
- (
495
- LocalProtocolError,
496
- HttpxRemoteProtocolError,
497
- HttpcoreRemoteProtocolError,
498
- ConnectError,
499
- SandboxException,
500
- )
501
- ),
502
- before_sleep=tenacity.before_sleep_log(_LOGGER, logging.INFO),
503
- after=tenacity.after_log(_LOGGER, logging.INFO),
504
- )
505
- def exec_cell(self, code: str) -> Execution:
506
- self.interpreter.set_timeout(_SESSION_TIMEOUT) # Extend the life of the sandbox
507
- try:
508
- _LOGGER.info(
509
- f"Start code execution in remote sandbox {self.interpreter.sandbox_id}. Timeout: {_SESSION_TIMEOUT}. Code hash: {hash(code)}"
510
- )
511
- execution = self.interpreter.notebook.exec_cell(
512
- code=code,
513
- on_stdout=lambda msg: _LOGGER.info(msg),
514
- on_stderr=lambda msg: _LOGGER.info(msg),
515
- )
516
- _LOGGER.info(
517
- f"Finished code execution in remote sandbox {self.interpreter.sandbox_id}. Code hash: {hash(code)}"
518
- )
519
- return Execution.from_e2b_execution(execution)
520
- except (
521
- LocalProtocolError,
522
- HttpxRemoteProtocolError,
523
- HttpcoreRemoteProtocolError,
524
- ConnectError,
525
- SandboxException,
526
- ) as e:
527
- raise e
528
- except Exception as e:
529
- raise RemoteSandboxExecutionError(
530
- f"Failed executing code in remote sandbox ({self.interpreter.sandbox_id}) due to error '{type(e).__name__} {str(e)}', code: {code}"
531
- ) from e
532
-
533
- @tenacity.retry(
534
- wait=tenacity.wait_exponential_jitter(),
535
- stop=tenacity.stop_after_attempt(3),
536
- retry=tenacity.retry_if_exception_type(
537
- (
538
- LocalProtocolError,
539
- HttpxRemoteProtocolError,
540
- HttpcoreRemoteProtocolError,
541
- ConnectError,
542
- SandboxException,
543
- )
544
- ),
545
- before_sleep=tenacity.before_sleep_log(_LOGGER, logging.INFO),
546
- after=tenacity.after_log(_LOGGER, logging.INFO),
547
- )
548
- def upload_file(self, file: Union[str, Path]) -> Path:
549
- file_name = Path(file).name
550
- with open(file, "rb") as f:
551
- self.interpreter.files.write(path=str(self.remote_path / file_name), data=f)
552
- _LOGGER.info(f"File ({file}) is uploaded to: {str(self.remote_path)}")
553
- return self.remote_path / file_name
554
-
555
- def download_file(
556
- self, remote_file_path: Union[str, Path], local_file_path: Union[str, Path]
557
- ) -> Path:
558
- with open(local_file_path, "w+b") as f:
559
- f.write(
560
- self.interpreter.files.read(path=str(remote_file_path), format="bytes")
561
- )
562
- _LOGGER.info(f"File ({remote_file_path}) is downloaded to: {local_file_path}")
563
- return Path(local_file_path)
564
-
565
- @staticmethod
566
- def _new_e2b_interpreter_impl(*args, **kwargs) -> E2BCodeInterpreterImpl: # type: ignore
567
- template_name = os.environ.get("E2B_TEMPLATE_NAME", "va-sandbox")
568
- _LOGGER.info(
569
- f"Creating a new E2BCodeInterpreter using template: {template_name}"
570
- )
571
- return E2BCodeInterpreterImpl(template=template_name, *args, **kwargs)
572
-
573
-
574
391
  class LocalCodeInterpreter(CodeInterpreter):
575
392
  def __init__(
576
393
  self,
@@ -723,12 +540,7 @@ class CodeInterpreterFactory:
723
540
  ) -> CodeInterpreter:
724
541
  if not code_sandbox_runtime:
725
542
  code_sandbox_runtime = os.getenv("CODE_SANDBOX_RUNTIME", "local")
726
- if code_sandbox_runtime == "e2b":
727
- envs = _get_e2b_env()
728
- instance: CodeInterpreter = E2BCodeInterpreter(
729
- timeout=_SESSION_TIMEOUT, remote_path=remote_path, envs=envs
730
- )
731
- elif code_sandbox_runtime == "local":
543
+ if code_sandbox_runtime == "local":
732
544
  instance = LocalCodeInterpreter(
733
545
  timeout=_SESSION_TIMEOUT,
734
546
  remote_path=remote_path,
@@ -736,25 +548,11 @@ class CodeInterpreterFactory:
736
548
  )
737
549
  else:
738
550
  raise ValueError(
739
- f"Unsupported code sandbox runtime: {code_sandbox_runtime}. Supported runtimes: e2b, local"
551
+ f"Unsupported code sandbox runtime: {code_sandbox_runtime}. Supported runtimes: local"
740
552
  )
741
553
  return instance
742
554
 
743
555
 
744
- def _get_e2b_env() -> Union[Dict[str, str], None]:
745
- openai_api_key = os.getenv("OPENAI_API_KEY", "")
746
- anthropic_api_key = os.getenv("ANTHROPIC_API_KEY", "")
747
- if openai_api_key or anthropic_api_key:
748
- envs = {"WORKSPACE": os.getenv("WORKSPACE", "/home/user")}
749
- if openai_api_key:
750
- envs["OPENAI_API_KEY"] = openai_api_key
751
- if anthropic_api_key:
752
- envs["ANTHROPIC_API_KEY"] = anthropic_api_key
753
- else:
754
- envs = None
755
- return envs
756
-
757
-
758
556
  def _parse_local_code_interpreter_outputs(outputs: List[Dict[str, Any]]) -> Execution:
759
557
  """Parse notebook cell outputs to Execution object. Output types:
760
558
  https://nbformat.readthedocs.io/en/latest/format_description.html#code-cell-outputs
File without changes
File without changes