Skip to content

Commit

Permalink
chore(streaming): silence pydantic model_dump warnings (#1722)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristapratico authored and stainless-app[bot] committed Sep 19, 2024
1 parent bcf9fcc commit 349b7f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/openai/lib/streaming/_assistants.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,11 +906,11 @@ def accumulate_run_step(
merged = accumulate_delta(
cast(
"dict[object, object]",
snapshot.model_dump(exclude_unset=True),
snapshot.model_dump(exclude_unset=True, warnings=False),
),
cast(
"dict[object, object]",
data.delta.model_dump(exclude_unset=True),
data.delta.model_dump(exclude_unset=True, warnings=False),
),
)
run_step_snapshots[snapshot.id] = cast(RunStep, construct_type(type_=RunStep, value=merged))
Expand Down Expand Up @@ -948,7 +948,7 @@ def accumulate_event(
construct_type(
# mypy doesn't allow Content for some reason
type_=cast(Any, MessageContent),
value=content_delta.model_dump(exclude_unset=True),
value=content_delta.model_dump(exclude_unset=True, warnings=False),
),
),
)
Expand All @@ -957,11 +957,11 @@ def accumulate_event(
merged = accumulate_delta(
cast(
"dict[object, object]",
block.model_dump(exclude_unset=True),
block.model_dump(exclude_unset=True, warnings=False),
),
cast(
"dict[object, object]",
content_delta.model_dump(exclude_unset=True),
content_delta.model_dump(exclude_unset=True, warnings=False),
),
)
current_message_snapshot.content[content_delta.index] = cast(
Expand Down

0 comments on commit 349b7f6

Please sign in to comment.