Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Conversation

@joelwilliamson
Copy link

The schema for CodeInterpreterTool says that the result of the code should be printed, but CodeInterpreterTool.run_in_restricted_sandbox and CodeInterpreterTool.run_code_unsafe both try to get the result from a result variable. This is inconsistent with how run_code_in_docker gets its results and seems to often cause task failures.

Use contextlib.redirect_stdout to capture the output from code that is exec'ed so all execution methods get whatever the code output.

The schema for CodeInterpreterTool says that the result of the code should be printed, but CodeInterpreterTool.run_in_restricted_sandbox and CodeInterpreterTool.run_code_unsafe both try to get the result from a `result` variable. This is inconsistent with how `run_code_in_docker` gets its results and seems to often cause task failures.

Use contextlib.redirect_stdout to capture the output from code that is exec'ed so all execution methods get whatever the code output.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant