Skip to content
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

Add dummy tool call id for models that doesn't return it #933

Closed

Conversation

AlexEnrique
Copy link

Attempt to fix #895

Changes

  • Added dummy_tool_call_id to _utils.py
  • Used dummy_tool_call_id in models/gemini.py and models/mistral.py, where it was found that tool call id could be None:
  • Updates test for Gemini after using dummy_tool_call_id. No tests were added since the updated tests already verify the usage of the dummy id.
  • Added test_request_tool_call_with_no_id_from_model test for Mistral to test usage of dummy_tool_call_id when MistralToolCall has id == None.

@github-actions github-actions bot temporarily deployed to deploy-preview February 15, 2025 16:28 Inactive
@Kludex
Copy link
Member

Kludex commented Feb 27, 2025

I think the problem is that we are not sending a tool_call_id to Gemini, isn't it?


EDIT: I see the field id from Gemini, but I don't understand when it's returned.

@Kludex
Copy link
Member

Kludex commented Mar 25, 2025

I've merged a fix for the issue on #1229

Thanks for the PR! :)

@Kludex Kludex closed this Mar 25, 2025
@AlexEnrique
Copy link
Author

Sorry, I couldn't work on this since the PR.

Thanks for the fix and for the great library you from Pydantic are building!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssertionError: OpenAI requires tool_call_id
2 participants