Files
X-Financial/server/src/app/schemas/hermes.py

26 lines
599 B
Python

from __future__ import annotations
from typing import Any, Literal
from pydantic import BaseModel, Field
HermesCallbackStatus = Literal["running", "succeeded", "failed"]
class HermesCallbackWrite(BaseModel):
type: str = Field(min_length=1, max_length=80)
run_id: str = Field(min_length=1, max_length=80)
status: HermesCallbackStatus
summary: str = ""
error: str = ""
payload: dict[str, Any] = Field(default_factory=dict)
class HermesCallbackRead(BaseModel):
ok: bool = True
accepted: bool = True
type: str
run_id: str
status: HermesCallbackStatus