from __future__ import annotations

from abc import ABC, abstractmethod
from enum import IntEnum
from typing import List

from pydantic import BaseModel

from srs2std.evaluate.factcheck_strategies.scorers.scorer import Reference, Scorer


class FactcheckStrategy(ABC):
    def __init__(self, threshold: float, scorer: Scorer):
        self.threshold = threshold
        self.scorer = scorer

    @abstractmethod
    def run(self, doc: str, claims: List[str]) -> List[Verdict]:
        pass


class Verdict(BaseModel):
    conclusion: Conclusion
    claim: str
    evidence: Reference


class Conclusion(IntEnum):
    SUPPORTED = 1
    UNSUPPORTED = 0
