Common: Make PydanticEventSerializer generic

This commit is contained in:
Mike Salvatore 2022-09-13 07:50:38 -04:00
parent 62ab6e5a77
commit 34e843f7f3
1 changed files with 2 additions and 2 deletions

View File

@ -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