diff --git a/monkey/common/event_serializers/pydantic_event_serializer.py b/monkey/common/event_serializers/pydantic_event_serializer.py index fab4f8c06..87ac201f8 100644 --- a/monkey/common/event_serializers/pydantic_event_serializer.py +++ b/monkey/common/event_serializers/pydantic_event_serializer.py @@ -1,5 +1,5 @@ import logging -from typing import Type, TypeVar +from typing import Generic, Type, TypeVar from common.events import AbstractAgentEvent @@ -10,7 +10,7 @@ logger = logging.getLogger(__name__) T = TypeVar("T", bound=AbstractAgentEvent) -class PydanticEventSerializer(IEventSerializer): +class PydanticEventSerializer(IEventSerializer, Generic[T]): def __init__(self, event_class: Type[T]): self._event_class = event_class