Save run output to user's media collection
When a recipe run completes, save the output to the user's media with description and source tracking. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -399,6 +399,18 @@ def execute_dag(self, dag_json: str, run_id: str = None) -> dict:
|
|||||||
ipfs_cid=output_ipfs_cid,
|
ipfs_cid=output_ipfs_cid,
|
||||||
actor_id=actor_id,
|
actor_id=actor_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Save output as media for the user
|
||||||
|
if actor_id:
|
||||||
|
await database.save_item_metadata(
|
||||||
|
content_hash=output_hash,
|
||||||
|
actor_id=actor_id,
|
||||||
|
item_type="media",
|
||||||
|
description=f"Output from recipe: {recipe_name}",
|
||||||
|
source_type="recipe",
|
||||||
|
source_note=f"run_id: {run_id}",
|
||||||
|
)
|
||||||
|
|
||||||
# Clean up pending run
|
# Clean up pending run
|
||||||
if pending:
|
if pending:
|
||||||
await database.complete_pending_run(run_id)
|
await database.complete_pending_run(run_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user