Commit ea3320d
Python: Fix OpenAI Responses streaming to propagate
* Fix streaming response losing created_at from response.completed event (microsoft#5347)
The streaming path in _parse_chunk_from_openai did not extract created_at
from the response.completed event, unlike the non-streaming path in
_parse_responses_response. This caused durabletask persistence warnings
when created_at was None.
Extract created_at in the response.completed case and pass it to the
returned ChatResponseUpdate.
Also fix pre-existing pyright errors for optional orjson import in sample
files.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix orjson import suppression to use pyright instead of mypy (microsoft#5347)
Replace `# type: ignore[import-not-found]` with
`# pyright: ignore[reportMissingImports]` on optional orjson imports
in conversation sample files, matching the repo's Pyright strict
configuration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>created_at from final response.completed event (microsoft#5382)1 parent 9e915b3 commit ea3320d
4 files changed
Lines changed: 31 additions & 2 deletions
File tree
- python
- packages/openai
- agent_framework_openai
- tests/openai
- samples/02-agents/conversations
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2028 | 2028 | | |
2029 | 2029 | | |
2030 | 2030 | | |
| 2031 | + | |
2031 | 2032 | | |
2032 | 2033 | | |
2033 | 2034 | | |
| |||
2209 | 2210 | | |
2210 | 2211 | | |
2211 | 2212 | | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
2212 | 2216 | | |
2213 | 2217 | | |
2214 | 2218 | | |
| |||
2589 | 2593 | | |
2590 | 2594 | | |
2591 | 2595 | | |
| 2596 | + | |
2592 | 2597 | | |
2593 | 2598 | | |
2594 | 2599 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2192 | 2192 | | |
2193 | 2193 | | |
2194 | 2194 | | |
| 2195 | + | |
2195 | 2196 | | |
2196 | 2197 | | |
2197 | 2198 | | |
| |||
4449 | 4450 | | |
4450 | 4451 | | |
4451 | 4452 | | |
| 4453 | + | |
4452 | 4454 | | |
4453 | 4455 | | |
4454 | 4456 | | |
4455 | 4457 | | |
4456 | 4458 | | |
4457 | 4459 | | |
4458 | 4460 | | |
| 4461 | + | |
| 4462 | + | |
| 4463 | + | |
| 4464 | + | |
| 4465 | + | |
| 4466 | + | |
| 4467 | + | |
| 4468 | + | |
| 4469 | + | |
| 4470 | + | |
| 4471 | + | |
| 4472 | + | |
| 4473 | + | |
| 4474 | + | |
| 4475 | + | |
| 4476 | + | |
| 4477 | + | |
| 4478 | + | |
| 4479 | + | |
| 4480 | + | |
| 4481 | + | |
| 4482 | + | |
4459 | 4483 | | |
4460 | 4484 | | |
4461 | 4485 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments