Repository navigation
fix(mistral): keep seed=0 and the caller's extra_body - #475
Open
pcbeingused333 wants to merge 3 commits into
Open
pcbeingused333 wants to merge 3 commits into
pcbeingused333 wants to merge 3 commits into
Conversation
ChatMistral translated `seed` to `extra_body={"random_seed": seed}` under a
truthiness check, so seed=0 was dropped, and it assigned a fresh extra_body,
discarding any extra_body supplied through kwargs.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
This branch has not been 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.
MistralProvider._chat_perform_argstranslatesseedinto Mistral'srandom_seedthroughextra_body, with two problems:if seed := kwargs2.pop("seed", None), soseed=0was falsy and the seed was dropped silently.ChatMistral(seed=0)sent norandom_seed.kwargs2["extra_body"] = {"random_seed": seed}, replacing anyextra_bodypassed throughkwargs(for example Mistral'ssafe_prompt).Now any non-
Noneseed is sent, andrandom_seedis merged into the existingextra_body. A non-integer seed still raises the same error.Tests. Two tests in
tests/test_provider_mistral.pycheck the request arguments forseed=0and for a seed combined with a userextra_body; both fail on main and pass here, and the rest of that file passes. No request was made to the Mistral API.This change was made with Claude Code.
🤖 Generated with Claude Code