Spaces:
Runtime error
Runtime error
| """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 | |
| def process(self, acordao_data: Dict[str, Any]) -> Dict[str, Any]: | |
| """Processa ac贸rd茫o""" | |
| pass | |
| 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() | |
| } |