OpenHands/openhands/app_server/event_callback/event_callback_result_models.py
Tim O'Farrell f292f3a84d
V1 Integration (#11183)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
2025-10-14 02:16:44 +00:00

36 lines
882 B
Python

from datetime import datetime
from enum import Enum
from uuid import UUID, uuid4
from pydantic import BaseModel, Field
from openhands.agent_server.utils import utc_now
from openhands.sdk.event.types import EventID
class EventCallbackResultStatus(Enum):
SUCCESS = 'SUCCESS'
ERROR = 'ERROR'
class EventCallbackResultSortOrder(Enum):
CREATED_AT = 'CREATED_AT'
CREATED_AT_DESC = 'CREATED_AT_DESC'
class EventCallbackResult(BaseModel):
"""Object representing the result of an event callback."""
id: UUID = Field(default_factory=uuid4)
status: EventCallbackResultStatus
event_callback_id: UUID
event_id: EventID
conversation_id: UUID
detail: str | None = None
created_at: datetime = Field(default_factory=utc_now)
class EventCallbackResultPage(BaseModel):
items: list[EventCallbackResult]
next_page_id: str | None = None