From e0a19aa6406acec872669918a8709c7e523f77fc Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 16 Oct 2024 19:04:25 -0500 Subject: [PATCH] listen for child classes --- griptape/events/event_listener.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/griptape/events/event_listener.py b/griptape/events/event_listener.py index 704e20d32b..df4a2668a0 100644 --- a/griptape/events/event_listener.py +++ b/griptape/events/event_listener.py @@ -49,7 +49,7 @@ def __exit__(self, type, value, traceback) -> None: # noqa: ANN001, A002 def publish_event(self, event: T, *, flush: bool = False) -> None: event_types = self.event_types - if event_types is None or type(event) in event_types: + if event_types is None or any(isinstance(event, event_type) for event_type in event_types): handled_event = event if self.handler is not None: handled_event = self.handler(event)