Repository navigation
fix: sync Gemini tool-call JSON and Messages container from Python any-llm - #28
Merged
Merged
Conversation
…y-llm Port mozilla-ai/any-llm #1330 and #1329: reject malformed Gemini tool-call arguments as InvalidRequestError, and add Messages container continuity for native Anthropic (rejected on the completions bridge, Meta, and Otari). Co-authored-by: Anurag Roy <anuragroy@duck.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
mozilla-ai/any-llm #1371 pins the Python Anthropic SDK below 1.x. That does not apply here: @anthropic-ai/sdk is still 0.x and already cannot resolve 1.x. Update the tracked source SHA on the existing sync PR. Co-authored-by: Anurag Roy <anuragroy@duck.com>
This was referenced Sep 8, 2026
anurag-roy
marked this pull request as ready for review
September 13, 2026 10:08
This branch was successfully deployed
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.
Sync with mozilla-ai/any-llm
mainthroughc1f167b(6 new commits since909d26e). One PR for the applicable library changes.Ported
InvalidRequestErrorinstead of being wrapped as{ arguments: "..." }. Empty strings and already-parsed objects still become{}/ the object. Tool schemas with JSON Schema type unions ({"type": ["string", "null"]}) already go throughparametersJsonSchemain this port, so the Python OpenAPISchema.typeenum path is not used. Vertex AI inherits the same conversion.containerfor continuing a previous top-level Anthropic code-execution container. Native Anthropic-family adapters forward it. The completions bridge rejects it withUnsupportedOperationError. Meta and Otari reject it withUnsupportedParameterError(Otari SDK 0.3.0 drops the field; Meta does not document it).Skipped (not applicable)
listBatchesalready takes optionallimit.Tracked source SHA is now
c1f167bc0d24d6321e2e02a61cf4363ccb6c3246.oxfmtandoxlintwere run after the changes.Note
Medium Risk
Gemini now throws on malformed tool-call JSON (behavior change for callers that relied on silent wrapping), and Messages
containeris a new request surface with provider-specific accept/reject rules.Overview
Syncs the TypeScript port with Python any-llm at
2388f59(patch changeset).Gemini tool-call arguments: Serialized assistant tool
function.argumentsthat are not valid JSON (strings, buffers) now fail at request build time withInvalidRequestErrorand a message naming the function, instead of silently wrapping bad input as{ arguments: "..." }. Empty encoded args still become{}; valid JSON and plain objects are unchanged. Provider name is threaded through message/batch conversion for error attribution.Messages
container: Adds optionalcontaineronMessagesParamsfor continuing a prior Anthropic top-level code-execution container. Native Anthropic forwards it onmessages.create. The default completions-backedmessages()path rejects it withUnsupportedOperationError; Meta and Otari reject withUnsupportedParameterError. Docs and parity manifest/commit pins are updated; tests cover forwarding and rejection paths.Reviewed by Cursor Bugbot for commit 81b4980. Bugbot is set up for automated code reviews on this repo. Configure here.