File size: 562 Bytes
dbaa71b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from typing import List, Any

from pydantic_settings import BaseSettings

from obsei.payload import TextPayload
from abc import abstractmethod


class BasePostprocessorConfig(BaseSettings):
    TYPE: str = "Base"

    class Config:
        multi_label = True


class BasePostprocessor(BaseSettings):
    TYPE: str = "Base"

    @abstractmethod
    def postprocess_input(
        self, input_list: List[TextPayload], config: BasePostprocessorConfig, **kwargs: Any
    ) -> List[TextPayload]:
        pass

    class Config:
        arbitrary_types_allowed = True