Carlex22's picture
ParaAIV3.0
e8216e0
raw
history blame
1.04 kB
"""Classe base abstrata para todos os processadores"""
from abc import ABC, abstractmethod
from typing import Dict, Any
from datetime import datetime
class ProcessorBase(ABC):
"""Classe base para processadores"""
def __init__(self, specialist_id: int, specialist_name: str):
self.specialist_id = specialist_id
self.specialist_name = specialist_name
self.confidence_score = 0
@abstractmethod
def process(self, acordao_data: Dict[str, Any]) -> Dict[str, Any]:
"""Processa ac贸rd茫o"""
pass
@abstractmethod
def get_schema(self) -> Dict[str, Any]:
"""Retorna schema JSON"""
pass
def post_process(self, result: Dict[str, Any]) -> Dict[str, Any]:
"""P贸s-processamento"""
return {
"specialist_id": self.specialist_id,
"specialist_name": self.specialist_name,
"result": result,
"confidence_score": self.confidence_score,
"timestamp": datetime.now().isoformat()
}