-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from typing import List | ||
from pydantic import BaseModel | ||
|
||
from aana.models.pydantic.base import BaseListModel | ||
|
||
|
||
class Caption(BaseModel): | ||
"""A model for a caption.""" | ||
|
||
__root__: str | ||
|
||
def __str__(self): | ||
return self.__root__ | ||
|
||
class Config: | ||
schema_extra = {"description": "A caption."} | ||
|
||
|
||
class CaptionsList(BaseListModel): | ||
"""A model for a list of captions.""" | ||
|
||
__root__: List[Caption] | ||
|
||
class Config: | ||
schema_extra = {"description": "A list of captions."} | ||
|
||
|
||
class VideoCaptionsList(BaseListModel): | ||
"""A model for a list of captions for a list of videos.""" | ||
|
||
__root__: List[CaptionsList] | ||
|
||
class Config: | ||
schema_extra = { | ||
"description": ( | ||
"A list of a list of captions. " | ||
"For a list of videos and a list of captions for each video " | ||
"and for each video we have a list of captions" | ||
) | ||
} |