Skip to content

Commit 0eec353

Browse files
authored
Python: Add OpenAI's sequence_number attribute to unit tests based on their latest package (#12227)
### Motivation and Context OpenAI release a new python package (1.81.0) which has some updates to the underlying Pydantic models for the Responses API. We need to pull in a new change for `ResponseOutputItemDoneEvent`, `ResponseOutputItemAddedEvent`, and `ResponseTextDeltaEvent` for streaming invocation which now has `sequence_number` attribute. <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description Bring in a change from OpenAI's Python SDK from v1.81.0 related to SK's OpenAIResponsesAgent. <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄
1 parent 28e0a92 commit 0eec353

File tree

2 files changed

+77
-19
lines changed

2 files changed

+77
-19
lines changed

python/tests/unit/agents/openai_responses/test_openai_responses_thread_actions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ async def __anext__(self):
252252
item_id="fake-item-id",
253253
output_index=0,
254254
type="response.output_text.delta",
255+
sequence_number=0,
255256
)
256257

257258
mock_stream_event_end = ResponseOutputItemDoneEvent(
@@ -263,6 +264,7 @@ async def __anext__(self):
263264
type="message",
264265
),
265266
output_index=0,
267+
sequence_number=0,
266268
type="response.output_item.done",
267269
)
268270

@@ -321,6 +323,7 @@ async def __anext__(self):
321323
),
322324
output_index=0,
323325
type="response.output_item.added",
326+
sequence_number=0,
324327
)
325328

326329
mock_stream_event_end = ResponseOutputItemDoneEvent(
@@ -332,6 +335,7 @@ async def __anext__(self):
332335
type="message",
333336
),
334337
output_index=0,
338+
sequence_number=0,
335339
type="response.output_item.done",
336340
)
337341

0 commit comments

Comments
 (0)