for fixing model dump with state

This commit is contained in:
lorenzejay
2026-01-21 13:01:42 -08:00
parent b0abf169b0
commit edd1fd73cd

View File

@@ -443,7 +443,7 @@ class StateProxy(Generic[T]):
"""Return the underlying state object."""
return cast(T, object.__getattribute__(self, "_proxy_state"))
def model_dump(self) -> dict[str, Any]:
def model_dump(self, *args: Any, **kwargs: Any) -> dict[str, Any]:
"""Return state as a dictionary.
Works for both dict and BaseModel underlying states.
@@ -451,7 +451,7 @@ class StateProxy(Generic[T]):
state = object.__getattribute__(self, "_proxy_state")
if isinstance(state, dict):
return state
result: dict[str, Any] = state.model_dump()
result: dict[str, Any] = state.model_dump(*args, **kwargs)
return result