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

mistral[patch]: translate tool call IDs to mistral compatible format #24668

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

ccurme
Copy link
Collaborator

@ccurme ccurme commented Jul 25, 2024

Mistral appears to have added validation for the format of its tool call IDs:

{"object":"error","message":"Tool call id was abc123 but must be a-z, A-Z, 0-9, with a length of 9.","type":"invalid_request_error","param":null,"code":null}

This breaks compatibility of messages from other providers. Here we add a function that converts any string to a Mistral-valid tool call ID, and apply it to incoming messages.

@efriis efriis added the partner label Jul 25, 2024
Copy link

vercel bot commented Jul 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Jul 25, 2024 2:17pm

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 25, 2024
@efriis efriis self-assigned this Jul 25, 2024
@dosubot dosubot bot added the 🤖:improvement Medium size change to existing code to handle new use-cases label Jul 25, 2024
@ccurme ccurme merged commit dfbd12b into master Jul 25, 2024
24 checks passed
@ccurme ccurme deleted the cc/mistral_translate_ids branch July 25, 2024 16:39
olgamurraft pushed a commit to olgamurraft/langchain that referenced this pull request Aug 16, 2024
…angchain-ai#24668)

Mistral appears to have added validation for the format of its tool call
IDs:

`{"object":"error","message":"Tool call id was abc123 but must be a-z,
A-Z, 0-9, with a length of
9.","type":"invalid_request_error","param":null,"code":null}`

This breaks compatibility of messages from other providers. Here we add
a function that converts any string to a Mistral-valid tool call ID, and
apply it to incoming messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases partner size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants