Record Completed Run • AI Agent SDK

record_completed_run: Persist a pointer to the trace file of the just-completed run.

record_completed_run

Function

</div>

This function is defined in the last_run module.

Persist a pointer to the trace file of the just-completed run.

Signature

python
def record_completed_run(trace_path: Any, meta: Optional[Dict[str, Any]]) -> Path

Parameters

ParamField Any

Path to the trace artifact (JSON or JSONL).

ParamField Optional

Optional run metadata (agent name, status, etc.).

Returns

ResponseField Path

The path the pointer was written to.

Uses

  • resolve
  • Path
  • time.time
  • last_run_pointer_path
  • json.dumps

Source

View on GitHub

praisonaiagents/trace/last_run.py at line 60