diff --git a/src/openai/lib/streaming/responses/_responses.py b/src/openai/lib/streaming/responses/_responses.py index 6975a9260d..2c803889c4 100644 --- a/src/openai/lib/streaming/responses/_responses.py +++ b/src/openai/lib/streaming/responses/_responses.py @@ -328,7 +328,9 @@ def accumulate_event(self, event: RawResponseStreamEvent) -> ParsedResponseSnaps return self._create_initial_response(event) if event.type == "response.output_item.added": - if event.item.type == "function_call": + if event.item is None: + pass + elif event.item.type == "function_call": snapshot.output.append( construct_type_unchecked( type_=cast(Any, ParsedResponseFunctionToolCall), value=event.item.to_dict()