Skip to main content
client.runs does from Python what valkyrie run does from the Valkyrie CLI. The rules for each action, such as which tasks a retry reruns, are on the CLI guides that each section links to. Every parameter is in the client.runs reference. The examples run inside async with ValkyrieClient() as client:, as in the quickstart.

Start a run

agent is a name from your library or an AgentContractRequest. The other options match valkyrie run start, including task_ids, slice_str, provider, and priority.

Follow a run

stream yields an update each time the run changes, until it finishes.

List runs

list returns one page. iter walks every page and keeps your filters:
filter_options returns the values your organization’s earlier runs used, which the filters accept.

Change, stop, and rerun a run

stop(force=True) also deletes running sandboxes. resume and retry take the same options as the CLI, such as from_scratch, update_agent, secrets, and service_headers. See Manage a run for what each one reruns. retag moves the run to another project in any run state and returns that project; metadata(run_id).project shows the newest.

Get results

Passing task_ids recomputes the score over those tasks only. metadata returns the settings the run started with.

Download outputs

Download and extract the files your agents wrote into a new directory:
Leave out task_ids for the whole run. The directory must not exist yet. To stream the tar archive yourself instead:
To list or download individual files, see Download artifacts.

Analyze a run

Send a finished run to its Docent analyzer. A first analysis needs the analyzer’s name from the agent contract: