Skip to content

get_annotated_type_for_event_classes

autogen.events.get_annotated_type_for_event_classes #

get_annotated_type_for_event_classes()
Source code in autogen/events/base_event.py
@export_module("autogen.events")
def get_annotated_type_for_event_classes() -> type[Any]:
    # this is a dynamic type so we need to disable the type checker
    union_type = Union[tuple(_event_classes.values())]  # type: ignore[valid-type]
    return Annotated[union_type, Field(discriminator="type")]  # type: ignore[return-value]