Current behavior
When it's a union type it complains:
union = MyModel1 | MyModel2
@streaming_action.pydantic(
reads=[...],
writes=[...],
state_input_type=...,
state_output_type=...
stream_type=union, # type hint says this is invalid
)
because it is typed with :
stream_type: Union[Type["BaseModel"], Type[dict]],
Library & System Information
Latest burr
Expected behavior
It should be fine.
Additional context
The fix I think is to expand that stream type to handle a union of BaseModel types.