88import httpx
99
1010from ..._utils import is_dict , is_list , consume_sync_iterator , consume_async_iterator
11+ from ..._compat import model_dump
1112from ..._models import construct_type
1213from ..._streaming import Stream , AsyncStream
1314from ...types .beta import AssistantStreamEvent
@@ -906,11 +907,11 @@ def accumulate_run_step(
906907 merged = accumulate_delta (
907908 cast (
908909 "dict[object, object]" ,
909- snapshot . model_dump (exclude_unset = True , warnings = False ),
910+ model_dump (snapshot , exclude_unset = True , warnings = False ),
910911 ),
911912 cast (
912913 "dict[object, object]" ,
913- data .delta . model_dump ( exclude_unset = True , warnings = False ),
914+ model_dump ( data .delta , exclude_unset = True , warnings = False ),
914915 ),
915916 )
916917 run_step_snapshots [snapshot .id ] = cast (RunStep , construct_type (type_ = RunStep , value = merged ))
@@ -948,7 +949,7 @@ def accumulate_event(
948949 construct_type (
949950 # mypy doesn't allow Content for some reason
950951 type_ = cast (Any , MessageContent ),
951- value = content_delta . model_dump (exclude_unset = True , warnings = False ),
952+ value = model_dump (content_delta , exclude_unset = True , warnings = False ),
952953 ),
953954 ),
954955 )
@@ -957,11 +958,11 @@ def accumulate_event(
957958 merged = accumulate_delta (
958959 cast (
959960 "dict[object, object]" ,
960- block . model_dump (exclude_unset = True , warnings = False ),
961+ model_dump (block , exclude_unset = True , warnings = False ),
961962 ),
962963 cast (
963964 "dict[object, object]" ,
964- content_delta . model_dump (exclude_unset = True , warnings = False ),
965+ model_dump (content_delta , exclude_unset = True , warnings = False ),
965966 ),
966967 )
967968 current_message_snapshot .content [content_delta .index ] = cast (
0 commit comments