Skip to content

docs(quickstart): force tool_choice in OpenAI function-calling example - #317

Open
IljaZakharov wants to merge 1 commit into
e2b-dev:mainfrom
IljaZakharov:fix-openai-connect-llm-exmpl-2026-07-29
Open

docs(quickstart): force tool_choice in OpenAI function-calling example#317
IljaZakharov wants to merge 1 commit into
e2b-dev:mainfrom
IljaZakharov:fix-openai-connect-llm-exmpl-2026-07-29

Conversation

@IljaZakharov

Copy link
Copy Markdown

The OpenAI "Function calling" example in connect-llms.mdx left tool_choice
at its default ("auto"), so gpt-4o was free to answer questions like "how
many r's are in strawberry" directly from its own knowledge instead of
calling execute_python. The example still looked like it demonstrated the
E2B sandbox, but the if response_message.tool_calls: block could be
skipped entirely, silently returning an answer that never touched the
sandbox.

Pass tool_choice explicitly requesting the execute_python function so the
example always exercises the sandbox, matching what it claims to show.

The OpenAI "Function calling" example in connect-llms.mdx left tool_choice
at its default ("auto"), so gpt-4o was free to answer questions like "how
many r's are in strawberry" directly from its own knowledge instead of
calling execute_python. The example still looked like it demonstrated the
E2B sandbox, but the `if response_message.tool_calls:` block could be
skipped entirely, silently returning an answer that never touched the
sandbox.

Pass tool_choice explicitly requesting the execute_python function so the
example always exercises the sandbox, matching what it claims to show.
@cla-bot

cla-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @IljaZakharov on file. You can sign our CLA at https://e2b.dev/docs/cla . Once you've signed, post a comment here that says '@cla-bot check'

@IljaZakharov

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Jul 29, 2026
@cla-bot

cla-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant