from pathlib import Path
import torch
from bench_af._abstract.objects import Detector, Environment, EvalLog, ModelOrganism
from typing import override
from bench_af.util.judge import assess_model_bias

CURRENT_DIRECTORY = Path(__file__).parent


class MyDetector(Detector):
    def __init__(self) -> None:
        super().__init__(
            name=CURRENT_DIRECTORY.name,
            supported_model_organisms=set(),
            supported_environments=set(),
        )
        self.activation_cache: dict[str, torch.Tensor] = {}

    @override
    def modify_environment(self, environment: Environment) -> None:
        pass

    @override
    def modify_model_organism(self, model_organism: ModelOrganism) -> None:
        pass

    @override
    def get_prediction(self, eval_logs: list[EvalLog]) -> tuple[float, str]:
        return assess_model_bias("*Example bias*", eval_logs[0])


def get() -> Detector:
    return MyDetector()
