Commit eb29c47
authored
fix(dspy): exclude gpt-5-chat from reasoning model classification (stanfordnlp#9033)
The regex pattern for identifying reasoning models was incorrectly
matching gpt-5-chat, causing it to be subject to reasoning model
validation requirements and attempting to pass reasoning parameters
that Azure's API doesn't support for this model.
Updated the regex to use negative lookahead (?!-chat) to exclude
gpt-5-chat while still allowing other gpt-5 variants like gpt-5-mini,
gpt-5-nano, and gpt-5-pro to be recognized as reasoning models.
- Updated regex pattern in dspy/clients/lm.py
- Added test case for gpt-5-chat in test_reasoning_model_token_parameter
- Added dedicated test test_gpt_5_chat_not_reasoning_model
Fixes issue where gpt-5-chat (Azure AI Foundry) was incorrectly
classified as a reasoning model, preventing normal usage with
standard temperature and max_tokens values.1 parent fc1170a commit eb29c47
2 files changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
| |||
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
321 | | - | |
| 322 | + | |
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
| |||
347 | 348 | | |
348 | 349 | | |
349 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
350 | 366 | | |
351 | 367 | | |
352 | 368 | | |
| |||
0 commit comments