refactored config

This commit is contained in:
Robert 2024-03-08 22:45:29 +07:00
parent 9be715e16a
commit 0806626f51
No known key found for this signature in database
GPG Key ID: F631C7FD957D5F22

View File

@ -8,23 +8,20 @@ from typing import Literal, Union, Annotated, Optional, List
class BaseAction(BaseModel):
action_type: Literal["wait", "comment"]
class Config(BaseConfig):
pass
class WaitAction(BaseAction):
action_type: Literal["wait"]
wait_for: int
class Config(BaseConfig):
pass
class CommentAction(BaseAction):
action_type: Literal["comment"]
text: Annotated[Optional[str], Field(default=None)]
file_urls: Annotated[Optional[List[str]], Field(default=[])]
class Config(BaseConfig):
pass
Action = Annotated[Union[WaitAction, CommentAction], Field(description="action_type")]