Commit dacbc03
committed
fix: handle both output formats in Responses API parsing
Fixed "Failed to parse OpenAI Responses API response" error that was
breaking agentic tools with Ollama, LM Studio, and other OpenAI-compatible
providers.
Changes:
- Added #[serde(default)] to ResponseAPIResponse fields to handle missing fields
- Added support for both output_text (string) and output (array) response formats
- Added ResponseOutput struct to deserialize array elements
- Updated generate_chat to try output_text first, then fall back to output array
This ensures the parser handles response variations across different providers
and matches the behavior of the official OpenAI provider implementation.1 parent 5041b27 commit dacbc03
1 file changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
316 | 329 | | |
317 | | - | |
| 330 | + | |
318 | 331 | | |
319 | 332 | | |
320 | 333 | | |
| |||
446 | 459 | | |
447 | 460 | | |
448 | 461 | | |
| 462 | + | |
449 | 463 | | |
| 464 | + | |
450 | 465 | | |
451 | 466 | | |
| 467 | + | |
| 468 | + | |
452 | 469 | | |
453 | 470 | | |
454 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
455 | 480 | | |
456 | 481 | | |
457 | 482 | | |
| |||
0 commit comments