refactored
This commit is contained in:
parent
803aec9a44
commit
12b57c8c0f
|
|
@ -5,7 +5,11 @@ from pydantic import BaseModel, Field
|
||||||
from typing import Literal, Union, Annotated, Optional, List
|
from typing import Literal, Union, Annotated, Optional, List
|
||||||
|
|
||||||
|
|
||||||
class WaitAction(BaseModel):
|
class BaseAction(BaseModel):
|
||||||
|
action_type: Literal["wait", "comment"]
|
||||||
|
|
||||||
|
|
||||||
|
class WaitAction(BaseAction):
|
||||||
action_type: Literal["wait"]
|
action_type: Literal["wait"]
|
||||||
wait_for: int
|
wait_for: int
|
||||||
|
|
||||||
|
|
@ -13,17 +17,15 @@ class WaitAction(BaseModel):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TextCommentAction(BaseModel):
|
class CommentAction(BaseAction):
|
||||||
action_type: Literal["text_comment"]
|
action_type: Literal["comment"]
|
||||||
text: str
|
text: str
|
||||||
|
|
||||||
class Config(BaseConfig):
|
class Config(BaseConfig):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
Action = Annotated[
|
Action = Annotated[Union[WaitAction, CommentAction], Field(description="action_type")]
|
||||||
Union[WaitAction, TextCommentAction], Field(description="action_type")
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class Chain(BaseMongoModel):
|
class Chain(BaseMongoModel):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user