Files
wehub-resource-sync ec436095dd
Book-CI / test (macos-latest) (push) Has been cancelled
Book-CI / test (ubuntu-latest) (push) Has been cancelled
Book-CI / test (windows-latest) (push) Has been cancelled
Release Fake Tag / publish (push) Has been cancelled
Deploy / deploy (macos-latest) (push) Has been cancelled
Deploy / deploy (ubuntu-latest) (push) Has been cancelled
Deploy / deploy (windows-latest) (push) Has been cancelled
Release to PyPI / Build & publish sglang-kt (push) Has been cancelled
Release to PyPI / Build kt-kernel (Python 3.11) (push) Has been cancelled
Release to PyPI / Build kt-kernel (Python 3.12) (push) Has been cancelled
Release to PyPI / Publish kt-kernel to PyPI (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:30:03 +08:00

47 lines
820 B
Python

from enum import Enum
from typing import Dict
import sqlalchemy
from pydantic import BaseModel, ConfigDict, Field
TODO = BaseModel
ObjectID = str
class Object(BaseModel):
id: ObjectID
object: str
model_config = ConfigDict(from_attributes=True)
# Pydantic Base Models
class ObjectWithCreatedTime(Object):
created_at: int
class Order(str, Enum):
ASC = "asc"
DESC = "desc"
def to_sqlalchemy_order(self):
match self:
case Order.ASC:
return sqlalchemy.asc
case Order.DESC:
return sqlalchemy.desc
Metadata = Dict[str, str]
MetadataField: Metadata = Field({},max_length=16, alias="metadata")
class DeleteResponse(Object):
deleted: bool = True
class OperationResponse(BaseModel):
operation: str
status: str