Repository navigation
sdk: make interpreterTool run code and answer provider tool calls - #85
Merged
Merged
Conversation
karthik2804
force-pushed
the
client-sdk-tools-cleanup
branch
from
November 19, 2026 13:39
f8ac1ca to
79660d4
Compare
karthik2804
force-pushed
the
client-sdk-tools-cleanup
branch
from
November 19, 2026 16:28
79660d4 to
5e95bdd
Compare
interpreterTool() now returns a strict Zod schema as inputSchema, which the
Vercel AI SDK consumes directly. toAnthropicTool(), toOpenAITool(), and the new
toToolDefinition() derive JSON Schema from it with z.toJSONSchema; hand-written
JSON Schema ToolDefinitions are still accepted.
- The derived schema and description are identical to the previous
hand-written output for every language configuration, pinned by a golden
fixture test.
- The input type narrows to the configured languages (no `dependencies` for
Python-only tools).
- inputSchema.safeParse() rejects unknown fields such as allowedHosts,
replacing hand-rolled argument checks in the ai-code-executor example.
- README documents Interpreter + tool setup for the Vercel AI SDK
ToolLoopAgent and the Anthropic SDK.
interpreterTool({ interpreters, policy }) now validates, runs, and
formats each tool call, replacing the glue every app had to write.
The interpreters' keys set the languages offered.
- call/parse/run/execute cover raw input, validation, structured
results, and Vercel AI SDK use.
- sandbox.anthropic, .openai, and .openaiResponses give each provider's
tool definition and a results() helper for its tool calls.
- withPolicy() derives a tool with a merged policy (e.g. per
conversation), the same way for every provider.
- Errors go back to the model as isError output, naming bad fields.
- zod is an optional peer dependency, exported only from /tools.
- Fix the example's zod resolution on a fresh clone and regenerate the
example lockfiles.
The schema and description the model sees are unchanged.
Co-authored-by: Thorsten Hans <thorsten.hans@gmail.com>
Signed-off-by: Karthik Ganeshram <kganeshr@akamai.com>
Signed-off-by: Karthik Ganeshram <kganeshr@akamai.com>
karthik2804
force-pushed
the
client-sdk-tools-cleanup
branch
from
November 20, 2026 11:26
5e95bdd to
5cdda29
Compare
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.
interpreterTool({ interpreters, policy }) now validates, runs, and formats each tool call, replacing the glue every app had to write. The interpreters' keys set the languages offered.
The schema and description the model sees are unchanged.