Pass screenshots from one block to another block (#4212)
This commit is contained in:
@@ -1227,6 +1227,7 @@ class AgentDB:
|
||||
workflow_run_block_id: str | None = None,
|
||||
thought_id: str | None = None,
|
||||
task_v2_id: str | None = None,
|
||||
limit: int | None = None,
|
||||
) -> list[Artifact]:
|
||||
try:
|
||||
async with self.Session() as session:
|
||||
@@ -1255,6 +1256,9 @@ class AgentDB:
|
||||
|
||||
query = query.order_by(ArtifactModel.created_at.desc())
|
||||
|
||||
if limit is not None:
|
||||
query = query.limit(limit)
|
||||
|
||||
artifacts = (await session.scalars(query)).all()
|
||||
LOG.debug("Artifacts fetched", count=len(artifacts))
|
||||
return [convert_to_artifact(a, self.debug_enabled) for a in artifacts]
|
||||
@@ -1286,6 +1290,7 @@ class AgentDB:
|
||||
workflow_run_block_id=workflow_run_block_id,
|
||||
thought_id=thought_id,
|
||||
task_v2_id=task_v2_id,
|
||||
limit=1,
|
||||
)
|
||||
return artifacts[0] if artifacts else None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user