docs(sandbox): document SDK-only path and add curl/OpenAI SDK tabs for the proxy - #391
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A reader using the LiteLLM SDK directly does not need a proxy to route code_interpreter to a sandbox; they only need to register the tool, install the interceptor as a callback, and call litellm.aresponses with the native code_interpreter tool. Adds an SDK section above the proxy walkthrough showing register_sandbox_tools + litellm.callbacks = [CodeInterpreterInterceptionLogger(...)] + litellm.aresponses, and drops the LiteLLM-SDK-pointed-at-proxy tab from the curl/OpenAI SDK tabs in step 4 since the SDK path now has its own section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to litellm-docs#385. The merged page only covered the proxy path for the code interpreter interceptor, so an SDK reader had to guess how to wire the callback. Two additions:
SDK section under
## Responses API code interpreter interceptor: a single Python block showingregister_sandbox_tools(...)+litellm.callbacks = [CodeInterpreterInterceptionLogger(enabled_providers=["openai"], sandbox_tool_name="my-e2b")]+litellm.aresponses(model="openai/gpt-5", tools=[{"type": "code_interpreter", ...}], input=...). No proxy needed; the interceptor swaps the nativecode_interpretertool forlitellm_code_execution, runs the emitted code through the phase 1 sandbox primitive, and continues the agentic loop.Tabs in proxy step 4: the "Call /v1/responses" step now shows curl and OpenAI SDK side by side, so an OpenAI SDK reader pointed at
localhost:4000/v1gets a copy-paste-able call. LiteLLM-SDK-pointed-at-proxy was dropped from this tab set since the standalone SDK section above covers the LiteLLM SDK case without the proxy hop.Test plan
npm startand verify the new SDK section renders athttp://localhost:3002/docs/sandbox#sdk#4-call-v1responsesregister_sandbox_toolssignature match feat(sandbox): code interpreter interceptor on the Responses API litellm#30905