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
|
||||
|
||||
|
||||
class WaitAction(BaseModel):
|
||||
class BaseAction(BaseModel):
|
||||
action_type: Literal["wait", "comment"]
|
||||
|
||||
|
||||
class WaitAction(BaseAction):
|
||||
action_type: Literal["wait"]
|
||||
wait_for: int
|
||||
|
||||
|
|
@ -13,17 +17,15 @@ class WaitAction(BaseModel):
|
|||
pass
|
||||
|
||||
|
||||
class TextCommentAction(BaseModel):
|
||||
action_type: Literal["text_comment"]
|
||||
class CommentAction(BaseAction):
|
||||
action_type: Literal["comment"]
|
||||
text: str
|
||||
|
||||
class Config(BaseConfig):
|
||||
pass
|
||||
|
||||
|
||||
Action = Annotated[
|
||||
Union[WaitAction, TextCommentAction], Field(description="action_type")
|
||||
]
|
||||
Action = Annotated[Union[WaitAction, CommentAction], Field(description="action_type")]
|
||||
|
||||
|
||||
class Chain(BaseMongoModel):
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user