You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- You have access to a Python shell that runs directly in the user's browser, enabling fast execution of code for analysis, calculations, or problem-solving. Use it in this response.
2303
-
- The Python code you write can incorporate a wide array of libraries, handle data manipulation or visualization, perform API calls for web-related tasks, or tackle virtually any computational challenge. Use this flexibility to **think outside the box, craft elegant solutions, and harness Python's full potential**.
2304
-
- To use it, **you must enclose your code within `<code_interpreter type="code" lang="python">` XML tags** and stop right away. If you don't, the code won't execute.
2305
-
- When writing code in the code_interpreter XML tag, Do NOT use the triple backticks code block for markdown formatting, example: ```py # python code ``` will cause an error because it is markdown formatting, it is not python code.
2306
-
- When coding, **always aim to print meaningful outputs** (e.g., results, tables, summaries, or visuals) to better interpret and verify the findings. Avoid relying on implicit outputs; prioritize explicit and clear print statements so the results are effectively communicated to the user.
2307
-
- After obtaining the printed output, **always provide a concise analysis, interpretation, or next steps to help the user understand the findings or refine the outcome further.**
2308
-
- If the results are unclear, unexpected, or require validation, refine the code and execute it again as needed. Always aim to deliver meaningful insights from the results, iterating if necessary.
2309
-
- **If a link to an image, audio, or any file is provided in markdown format in the output, ALWAYS regurgitate word for word, explicitly display it as part of the response to ensure the user can access it easily, do NOT change the link.**
2310
-
- All responses should be communicated in the chat's primary language, ensuring seamless understanding. If the chat is multilingual, default to English for clarity.
2311
-
2312
-
Ensure that the tools are effectively utilized to achieve the highest-quality analysis for the user."""
2299
+
#### Code Interpreter
2300
+
2301
+
You have access to a Python code interpreter via: `<code_interpreter type="code" lang="python"></code_interpreter>`
2302
+
2303
+
- The Python shell runs directly in the user's browser for fast execution of analysis, calculations, or problem-solving. Use it in this response.
2304
+
- You can use a wide array of libraries for data manipulation, visualization, API calls, or any computational task. Think outside the box and harness Python's full potential.
2305
+
- **You must enclose your code within `<code_interpreter type="code" lang="python">` XML tags** and stop right away. If you don't, the code won't execute.
2306
+
- Do NOT use triple backticks (```py ... ```) inside the XML tags — that is markdown formatting, not executable Python code.
- After obtaining output, **provide a concise analysis, interpretation, or next steps** to help the user understand the findings.
2309
+
- If results are unclear or unexpected, refine the code and re-execute. Iterate until you deliver meaningful insights.
2310
+
- **If a link to an image, audio, or any file appears in the output, display it exactly as-is** in your response so the user can access it. Do not modify the link.
2311
+
- Respond in the chat's primary language. Default to English if multilingual.
2312
+
2313
+
Ensure the code interpreter is effectively utilized to achieve the highest-quality analysis for the user."""
2314
+
2315
+
# Appended to the code interpreter prompt only when engine is pyodide (not jupyter)
2316
+
CODE_INTERPRETER_PYODIDE_FS_PROMPT="""
2317
+
2318
+
##### Persistent File System
2319
+
2320
+
- User-uploaded files are available at `/mnt/uploads/`. When the user asks you to work with their files, read from this directory.
2321
+
- You can also write output files to `/mnt/uploads/` so the user can access and download them from the file browser.
2322
+
- The file system persists across code executions within the same session.
2323
+
- Use `import os; os.listdir('/mnt/uploads')` to discover available files."""
0 commit comments