flag to control ai fallback (#3313)

This commit is contained in:
Shuchang Zheng
2025-08-29 05:24:17 +08:00
committed by GitHub
parent 015194f2a4
commit 916ab6c067
7 changed files with 48 additions and 2 deletions

View File

@@ -1366,6 +1366,7 @@ class AgentDB:
is_saved_task: bool = False,
status: WorkflowStatus = WorkflowStatus.published,
generate_script: bool = False,
ai_fallback: bool = False,
cache_key: str | None = None,
) -> Workflow:
async with self.Session() as session:
@@ -1385,6 +1386,7 @@ class AgentDB:
is_saved_task=is_saved_task,
status=status,
generate_script=generate_script,
ai_fallback=ai_fallback,
cache_key=cache_key,
)
if workflow_permanent_id:

View File

@@ -243,6 +243,7 @@ class WorkflowModel(Base):
model = Column(JSON, nullable=True)
status = Column(String, nullable=False, default="published")
generate_script = Column(Boolean, default=False, nullable=False)
ai_fallback = Column(Boolean, default=False, nullable=False)
cache_key = Column(String, nullable=True)
created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False)

View File

@@ -264,6 +264,7 @@ def convert_to_workflow(workflow_model: WorkflowModel, debug_enabled: bool = Fal
status=WorkflowStatus(workflow_model.status),
extra_http_headers=workflow_model.extra_http_headers,
generate_script=workflow_model.generate_script,
ai_fallback=workflow_model.ai_fallback,
cache_key=workflow_model.cache_key,
)

View File

@@ -77,6 +77,7 @@ class Workflow(BaseModel):
max_screenshot_scrolls: int | None = None
extra_http_headers: dict[str, str] | None = None
generate_script: bool = False
ai_fallback: bool = False
cache_key: str | None = None
created_at: datetime