fix actions

This commit is contained in:
jxxghp
2025-02-27 13:09:01 +08:00
parent 4a42b0d000
commit ab0008be86
16 changed files with 116 additions and 29 deletions
+6 -7
View File
@@ -1,7 +1,5 @@
from abc import ABC, abstractmethod
from pydantic.main import BaseModel
from app.chain import ChainBase
from app.schemas import ActionContext, ActionParams
@@ -10,7 +8,7 @@ class ActionChain(ChainBase):
pass
class BaseAction(BaseModel, ABC):
class BaseAction(ABC):
"""
工作流动作基类
"""
@@ -18,10 +16,6 @@ class BaseAction(BaseModel, ABC):
# 完成标志
_done_flag = False
def __init__(self):
super().__init__()
self.chain = ActionChain()
@property
@abstractmethod
def name(self) -> str:
@@ -32,6 +26,11 @@ class BaseAction(BaseModel, ABC):
def description(self) -> str:
pass
@property
@abstractmethod
def data(self) -> dict:
pass
@abstractmethod
def execute(self, params: ActionParams, context: ActionContext) -> ActionContext:
"""