2024-12-02 19:12:55 +01:00
|
|
|
from typing import List, Optional, Union
|
2024-09-24 15:05:30 +02:00
|
|
|
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
|
|
|
|
|
|
class EventsSubLabelBody(BaseModel):
|
|
|
|
subLabel: str = Field(title="Sub label", max_length=100)
|
|
|
|
subLabelScore: Optional[float] = Field(
|
|
|
|
title="Score for sub label", default=None, gt=0.0, le=1.0
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class EventsDescriptionBody(BaseModel):
|
2024-10-11 01:12:05 +02:00
|
|
|
description: Union[str, None] = Field(title="The description of the event")
|
2024-09-24 15:05:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
class EventsCreateBody(BaseModel):
|
|
|
|
source_type: Optional[str] = "api"
|
|
|
|
sub_label: Optional[str] = None
|
2024-12-01 15:47:37 +01:00
|
|
|
score: Optional[float] = 0
|
2024-09-24 15:05:30 +02:00
|
|
|
duration: Optional[int] = 30
|
|
|
|
include_recording: Optional[bool] = True
|
|
|
|
draw: Optional[dict] = {}
|
|
|
|
|
|
|
|
|
|
|
|
class EventsEndBody(BaseModel):
|
2024-12-01 15:47:37 +01:00
|
|
|
end_time: Optional[float] = None
|
2024-09-24 19:22:11 +02:00
|
|
|
|
|
|
|
|
2024-12-02 19:12:55 +01:00
|
|
|
class EventsDeleteBody(BaseModel):
|
|
|
|
event_ids: List[str] = Field(title="The event IDs to delete")
|
|
|
|
|
|
|
|
|
2024-09-24 19:22:11 +02:00
|
|
|
class SubmitPlusBody(BaseModel):
|
|
|
|
include_annotation: int = Field(default=1)
|