briefcase.events
pip install briefcase-ai[events]Emit functions are coroutines; await them inside an async context.
BriefcaseEvent, emit()
import asyncio
from briefcase.events import ( BriefcaseEvent, emit, emit_low_confidence, emit_drift_detected,)
async def main(): event = BriefcaseEvent( event_type="low_confidence", decision_id="dec-1", payload={"confidence": 0.4}, ) await emit(event) await emit_low_confidence({"id": "dec-1"}, 0.4, 0.7) await emit_drift_detected({"id": "dec-1"}, {"drift_score": 0.3})
asyncio.run(main())BriefcaseEvent(event_type, decision_id, timestamp=..., payload={}, idempotency_key=...)async emit(event)async emit_low_confidence(decision, confidence, threshold)async emit_drift_detected(decision, details=None)KafkaPublisher, WebhookEmitter
KafkaPublisher(brokers, topic).publish(event) -> boolawait WebhookEmitter( url, secret="", subscribed_events=None, timeout=10, allow_insecure_http=False,).emit(event) -> boolKafka uses the kafka extra. Webhooks are standard-library only, sign request
bodies with HMAC-SHA256, reject remote plain HTTP by default, and refuse redirects.