workflow run block description generation (#1482)
This commit is contained in:
@@ -2146,11 +2146,11 @@ class AgentDB:
|
||||
async def update_workflow_run_block(
|
||||
self,
|
||||
workflow_run_block_id: str,
|
||||
organization_id: str | None = None,
|
||||
status: BlockStatus | None = None,
|
||||
output: dict | list | str | None = None,
|
||||
failure_reason: str | None = None,
|
||||
task_id: str | None = None,
|
||||
organization_id: str | None = None,
|
||||
loop_values: list | None = None,
|
||||
current_value: str | None = None,
|
||||
current_index: int | None = None,
|
||||
@@ -2160,6 +2160,7 @@ class AgentDB:
|
||||
body: str | None = None,
|
||||
prompt: str | None = None,
|
||||
wait_sec: int | None = None,
|
||||
description: str | None = None,
|
||||
) -> WorkflowRunBlock:
|
||||
async with self.Session() as session:
|
||||
workflow_run_block = (
|
||||
@@ -2196,6 +2197,8 @@ class AgentDB:
|
||||
workflow_run_block.prompt = prompt
|
||||
if wait_sec:
|
||||
workflow_run_block.wait_sec = wait_sec
|
||||
if description:
|
||||
workflow_run_block.description = description
|
||||
await session.commit()
|
||||
await session.refresh(workflow_run_block)
|
||||
else:
|
||||
|
||||
@@ -494,6 +494,7 @@ class WorkflowRunBlockModel(Base):
|
||||
String, ForeignKey("workflow_run_blocks.workflow_run_block_id"), nullable=True
|
||||
)
|
||||
organization_id = Column(String, ForeignKey("organizations.organization_id"), nullable=True)
|
||||
description = Column(String, nullable=True)
|
||||
task_id = Column(String, ForeignKey("tasks.task_id"), nullable=True)
|
||||
label = Column(String, nullable=True)
|
||||
block_type = Column(String, nullable=False)
|
||||
|
||||
@@ -382,6 +382,7 @@ def convert_to_workflow_run_block(
|
||||
workflow_run_id=workflow_run_block_model.workflow_run_id,
|
||||
organization_id=workflow_run_block_model.organization_id,
|
||||
parent_workflow_run_block_id=workflow_run_block_model.parent_workflow_run_block_id,
|
||||
description=workflow_run_block_model.description,
|
||||
block_type=BlockType(workflow_run_block_model.block_type),
|
||||
label=workflow_run_block_model.label,
|
||||
status=BlockStatus(workflow_run_block_model.status),
|
||||
|
||||
Reference in New Issue
Block a user