""" Base class for all probes. Probes are measurement instruments - they reveal what's already there, they don't add or change anything. """ from abc import ABC, abstractmethod from typing import Any from ..core.model import NyxModel class BaseProbe(ABC): """Abstract base class for probing operations.""" def __init__(self, model: NyxModel): """ Initialize probe with a loaded model. Args: model: A NyxModel instance (must be loaded) """ self.model = model if not model._loaded: raise ValueError("Model must be loaded before creating probe") @property def name(self) -> str: """Name of this probe type.""" return self.__class__.__name__ @abstractmethod def probe(self, term: str, **kwargs) -> Any: """ Probe a single term. Args: term: The word/phrase to probe **kwargs: Probe-specific parameters Returns: Probe-specific result object """ pass def probe_batch(self, terms: list[str], **kwargs) -> list[Any]: """ Probe multiple terms. Default implementation just loops; subclasses can optimize. Args: terms: List of words/phrases to probe **kwargs: Probe-specific parameters Returns: List of probe results """ return [self.probe(term, **kwargs) for term in terms]