Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E2B Sandboxed Code Execution Integration #1397

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

YukiHinana
Copy link

This change adds a new built-in function for executing python code generated by OpenAI Chat Completion model and the supporting documentation for said function.

This change adds a new built-in function for executing python code generated by
OpenAI Chat Completion model and the supporting documentation for said function.
for code in frames['codejson']:
code_obj = json.loads(code)
code_text = json.loads(code_obj['function_call']['arguments'])['code']
self.sandbox.filesystem.write('/home/user/test.py', code_text)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hard coded, but since it is what is executed in the VM/sandbox. this is probably fine for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant