Repository navigation
Commit 7a957a0
authored
Python: Fix Mistral AI seed setting being rejected by the SDK (#14677)
`ChatRequest.Seed` was serialized for Mistral as `seed`, but Mistral's
chat completions take the value as `random_seed`, so a seed set on the
request did not reach the model as the deterministic-sampling seed.
`random_seed` could only be set through
`ChatRequestVendorMistralExtensions.RandomSeed`.
The Mistral request now maps `Seed` to `random_seed` and no longer sends
`seed`. `ChatRequestVendorMistralExtensions.RandomSeed` still takes
precedence when set (before, the extension unconditionally overwrote the
field, so a null extension value is now ignored instead of clearing the
mapped seed).
Added `MistralChatSeedTests` (no network): `Seed` becomes `random_seed`
without `seed`; the extension value wins over `Seed`; an extensions
object without `RandomSeed` keeps the seed; no seed sends neither field.
Three of the four fail on `master`.
This change was made with the help of an AI assistant (Claude Code); the
tests were run locally on net8.0.1 parent aeb4737 commit 7a957a0
3 files changed
Lines changed: 29 additions & 2 deletions
File tree
- python
- semantic_kernel/connectors/ai/mistral_ai/prompt_execution_settings
- tests/unit/connectors/ai/mistral_ai
- services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
0 commit comments