Skip to content

ProbeResult

🛈 DocStrings

What an agent answered.

Source code in src/acptui/probe.py
@dataclass(frozen=True)
class ProbeResult:
    """What an agent answered."""

    agent_id: str
    v2: bool
    """Whether it negotiated ACP v2."""
    version: str
    """The protocol version it answered (``"2"``, ``"1"``, ...) or ``""`` if it failed."""
    agent: str = ""
    """Its name and version, as it reports them."""
    error: str = ""
    """Why the test failed (it did not start, timed out, ...)."""
    time: float = 0.0

    @property
    def summary(self) -> str:
        """One line for the UI."""
        if self.v2:
            return f"speaks ACP v2 ({self.agent})" if self.agent else "speaks ACP v2"
        if self.version:
            return f"speaks ACP v{self.version}, not v2"
        return f"test failed: {self.error}"

agent class-attribute instance-attribute

agent: str = ''

Its name and version, as it reports them.

error class-attribute instance-attribute

error: str = ''

Why the test failed (it did not start, timed out, ...).

summary property

summary: str

One line for the UI.

v2 instance-attribute

v2: bool

Whether it negotiated ACP v2.

version instance-attribute

version: str

The protocol version it answered ("2", "1", ...) or "" if it failed.

:fa-brands-github: Show source on GitHub