Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: litellm tool serialization #2020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 18, 2025
Merged

Conversation

thiagosalvatore
Copy link
Contributor

This PR fixes the issue reported on #929

When serializing tools with a deep level of nesting, it was leaving behind some attributes, causing issues like Invalid schema for function 'search_shop_catalog': 'STRING' is not valid under any of the given schemas.

This PR does a small refactor on the _schema_to_dict function adding support for that.
The core issue was that after calling model_dump, there's no longer an entry of type types.Schema, so the logic inside properties was not being able to serialize the dict there.

I've also added one extra test for this specific scenario so we have coverage there too.

@seanzhou1023
Copy link
Collaborator

thanks for the fix :)

@seanzhou1023 seanzhou1023 added the ready to pull [Status] This PR is ready to be importing back to Google label Jul 18, 2025
@copybara-service copybara-service bot merged commit d0a330c into google:main Jul 18, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to pull [Status] This PR is ready to be importing back to Google
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants