Pass screenshots from one block to another block (#4212)

This commit is contained in:
Marc Kelechava
2025-12-05 12:30:05 -08:00
committed by GitHub
parent e1693b2fef
commit 1f6309c405
5 changed files with 183 additions and 23 deletions

View File

@@ -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