Skip to content

ViolationHandler

autogen.beta.network.hub.expectations.ViolationHandler #

Bases: Protocol

What the hub does when an evaluator fires.

Handlers are async because they may post envelopes or transition sessions. They must be tolerant of duplicate calls — the sweeper deduplicates per (session, expectation, violator) before invoking, but transient re-fires across hub restarts are possible since the fired-violation cache is in-memory only.

name instance-attribute #

name

handle async #

handle(hub, session_id, violation)
Source code in autogen/beta/network/hub/expectations.py
async def handle(
    self,
    hub: "Hub",
    session_id: str,
    violation: Violation,
) -> None: ...