first
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
"""AI-specific domain events (published by the AI Gateway / workers)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from asf_events.base import ASFEvent
|
||||
|
||||
|
||||
class AIInferenceRequested(ASFEvent):
|
||||
event_type: str = "ai.inference.requested"
|
||||
job_id: Optional[UUID] = None
|
||||
capability: str
|
||||
provider: str
|
||||
preferred_model: Optional[str] = None
|
||||
payload: Dict[str, Any]
|
||||
|
||||
|
||||
class AIInferenceCompleted(ASFEvent):
|
||||
event_type: str = "ai.inference.completed"
|
||||
job_id: Optional[UUID] = None
|
||||
execution_id: UUID
|
||||
capability: str
|
||||
provider: str
|
||||
model_used: str
|
||||
duration_ms: Optional[int] = None
|
||||
input_tokens: Optional[int] = None
|
||||
output_tokens: Optional[int] = None
|
||||
estimated_cost: Optional[float] = None
|
||||
payload: Dict[str, Any]
|
||||
|
||||
|
||||
class AIInferenceFailed(ASFEvent):
|
||||
event_type: str = "ai.inference.failed"
|
||||
job_id: Optional[UUID] = None
|
||||
execution_id: UUID
|
||||
capability: str
|
||||
provider: str
|
||||
error: str
|
||||
payload: Dict[str, Any] = {}
|
||||
Reference in New Issue
Block a user