Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Rephrase docs example

Tereza Tizkovae0865ad94968
diff --git a/apps/docs/src/app/hello-world/py/page.mdx b/apps/docs/src/app/hello-world/py/page.mdx
index 933be5a90..dac8e5b53 100644
--- a/apps/docs/src/app/hello-world/py/page.mdx
+++ b/apps/docs/src/app/hello-world/py/page.mdx
@@ -3,7 +3,7 @@ import imgChart from '@/images/hello-world-chart.png'
# Hello World
-This Python guide will show you basics of E2B:
+This Python guide will show you the basics of E2B:
- Connect the code interpreter to an LLM
- Prompt the LLM to generate the Python code
- Execute the AI-generated Python code in a secure E2B sandbox
@@ -15,8 +15,8 @@ Check out the [full code in our cookbook](https://github.com/e2b-dev/e2b-cookboo
1. Install Code Interpreter SDK
1. Prepare the prompt and tools for LLM
1. Prepare code interpreting
-1. Call LLM and parse response with tools
-1. Create code interpreter and run everything
+1. Call LLM and parse the response with tools
+1. Create a code interpreter and run everything
1. Save generated chart
@@ -85,7 +85,7 @@ tools = [
</CodeGroup>
This defines our system prompt and the `tools` dictionary with available tools for the LLM - namely the `"execute_python"` tool.
-A little bit later, we'll connect `"execute_python"` to the E2B's code interpretrer.
+A little bit later, we'll connect `"execute_python"` to the E2B's code interpreter.
## 3. Prepare code interpreting
@@ -114,10 +114,10 @@ def code_interpret(code_interpreter: CodeInterpreter, code: str):
```
</CodeGroup>
-This function takes the `CodeInterpreter` object from our SDK, and `code` as paramaters.
+This function takes the `CodeInterpreter` object from our SDK and `code` as paramaters.
The `code` parameter is the code generated by the LLM.
-Inside the function, we call the `code_interpreter.notebook.exec_cell()` method. The `exec_cell()` takes `code` argument, and executes this `code` inside E2B sandbox.
+Inside the function, we call the `code_interpreter.notebook.exec_cell()` method. The `exec_cell()` takes the `code` argument and executes this `code` inside E2B sandbox.
## 4. Call LLM and parse response with tools
We're using Claude 3 Opus. Get your [Anthropic API key](https://console.anthropic.com/), save it to `.env` file, and install the [Anthropic SDK](https://docs.anthropic.com/claude/reference/client-sdks).
@@ -182,12 +182,12 @@ def chat(code_interpreter: CodeInterpreter, user_message: str) -> Tuple[List[Res
## 5. Create code interpreter and run everything
-Now we put all together, and run our program. In the end of `main.py` add following code prompting the LLM to visualize a distribution of height of men and print the median.
+Now we are ready to run our program. At the end of `main.py` add the following code prompting the LLM to visualize a distribution of the height of men and print the median.
<CodeGroup isFileName title="main.py" isRunnable={false}>
```python {{ language: 'python' }}
def main():
- user_message = "Visualize a distribution of height of men based on the latest data you know. Also print the median value."
+ user_message = "Visualize a distribution of height of men based on the latest data you know. Also, print the median value."
# Create the CodeInterpreter object and save it as code_interpreter
with CodeInterpreter() as code_interpreter:
@@ -203,7 +203,7 @@ def main():
```
</CodeGroup>
-You should see similar results to this:
+You should see results similar to this:
```sh
stdout=['The median male height is 175.5 cm\n'] stderr=[]
@@ -215,7 +215,7 @@ We got our median in the logs (`stdout`, and `stderr`) but we also something int
<Figure size 800x400 with 1 Axes>
```
-6. Save generated chart
+## 6. Save generated chart
This looks like a plot. Let's save it to a file. Add the following to the end of `main.py`.
<CodeGroup isFileName title="main.py" isRunnable={false}>
@@ -236,7 +236,7 @@ This looks like a plot. Let's save it to a file. Add the following to the end of
```
</CodeGroup>
-The chart got saved to the `chart.png` file and it should look similar to this:
+The chart was saved to the `chart.png` file and it should look similar to this:
<Image
src={imgChart}