from __future__ import annotations

import json
import re
from typing import Any, Dict

from langchain_core.output_parsers import PydanticOutputParser
from pydantic import BaseModel

from agent.base.base_classifier import BaseClassifier
from app.utils.logging import setup_minimal_logging
from app.common.timed import timed
logger = setup_minimal_logging()

class InterruptionClassifier(BaseClassifier):
    PROMPT_FILE = "interruption.txt"
    REASONING_EFFORT = "low"

    @timed("InterruptionClassifier.run")
    def run(self, text: str) -> bool:
        output = self.chain.invoke(text)
        logger.info(f"Resultado modelo interrupção: {text}, {bool(eval(output.content))}")
        return bool(eval(output.content))