Skip to content

Commit 6d04193

Browse files
committed
fix(responses): don't include parsed_arguments when re-serialising
1 parent 361a909 commit 6d04193

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/openai/_utils/_transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def _transform_recursive(
212212
return data
213213

214214
if isinstance(data, pydantic.BaseModel):
215-
return model_dump(data, exclude_unset=True, mode="json")
215+
return model_dump(data, exclude_unset=True, mode="json", exclude=getattr(data, '__api_exclude__', None))
216216

217217
annotated_type = _get_annotated_type(annotation)
218218
if annotated_type is None:

src/openai/types/responses/parsed_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class ParsedResponseOutputMessage(ResponseOutputMessage, GenericModel, Generic[C
5555
class ParsedResponseFunctionToolCall(ResponseFunctionToolCall):
5656
parsed_arguments: object = None
5757

58+
__api_exclude__ = {'parsed_arguments'}
59+
5860

5961
ParsedResponseOutputItem: TypeAlias = Annotated[
6062
Union[

0 commit comments

Comments
 (0)