Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Fix code interpreting documentation snippets (#624)

never not exploringe5a3f249cc0a
diff --git a/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data-with-ai/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data-with-ai/page.mdx
index 5c71d7306..5e75c15eb 100644
--- a/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data-with-ai/page.mdx
+++ b/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data-with-ai/page.mdx
@@ -462,7 +462,7 @@ with open("../dataset.csv", "rb") as f:
def run_ai_generated_code(ai_generated_code: str):
print('Running the code in the sandbox....')
- execution = sbx.notebook.exec_cell(ai_generated_code)
+ execution = sbx.run_code(ai_generated_code)
print('Code execution finished!')
# First let's check if the code ran successfully.
diff --git a/apps/web/src/app/(docs)/docs/code-interpreting/create-charts-visualizations/static-charts/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreting/create-charts-visualizations/static-charts/page.mdx
index 527f9f7ab..28b5b2a39 100644
--- a/apps/web/src/app/(docs)/docs/code-interpreting/create-charts-visualizations/static-charts/page.mdx
+++ b/apps/web/src/app/(docs)/docs/code-interpreting/create-charts-visualizations/static-charts/page.mdx
@@ -39,8 +39,6 @@ if (firstResult.png) {
import base64
from e2b_code_interpreter import Sandbox
-sbx = Sandbox()
-
code_to_run = """
import matplotlib.pyplot as plt