Skip to content

fix(mistral): forward penalties in completions#5695

Open
he-yufeng wants to merge 1 commit into
pydantic:mainfrom
he-yufeng:fix/mistral-penalties-nonstreaming
Open

fix(mistral): forward penalties in completions#5695
he-yufeng wants to merge 1 commit into
pydantic:mainfrom
he-yufeng:fix/mistral-penalties-nonstreaming

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • forward presence_penalty and frequency_penalty in non-streaming Mistral completion requests
  • keep the non-streaming path aligned with the existing streaming Mistral request path
  • record the outgoing Mistral mock kwargs in the existing model tests and add a regression test

To verify

  • python -m py_compile pydantic_ai_slim\pydantic_ai\models\mistral.py tests\models\test_mistral.py
  • $env:PYTHONUTF8='1'; uv run ruff check pydantic_ai_slim\pydantic_ai\models\mistral.py tests\models\test_mistral.py
  • $env:PYTHONUTF8='1'; uv run pytest tests\models\test_mistral.py::test_non_streaming_forwards_penalties -q --basetemp .tmp\pytest-5657 -p no:cacheprovider

Related: #5657

@github-actions github-actions Bot added size: S Small PR (≤100 weighted lines) bug Report that something isn't working, or PR implementing a fix labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Report that something isn't working, or PR implementing a fix size: S Small PR (≤100 weighted lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant