Skip to main content
These methods query the runs attached to a dataset experiment. For deprecation dates, minimum SDK versions, and the agent prompt that applies to every method, see Migrate to SmithDB-backed SDK methods.

Dataset experiment runs: query

Query dataset examples together with the experiment runs recorded against each example. Accepts one or more experiment_ids so you can view runs from multiple experiments side by side; results are returned as a cursor-paginated page.

Main changes

Method name

client.datasets.experiment_runs.query() is now async. Call it with await.
See the reference for the full parameter and field list.

Query parameters

experiment_ids is required and replaces session_ids. Values are still experiment tracing-project UUIDs—if you only know the experiment’s name, resolve it first: client.read_project(project_name="my-experiment").id, or await client.aread_project(project_name="my-experiment") in async code.

Response fields

Each page item is a dataset example paired with the runs produced for it—not a bare Run. Its runs field holds the same Run objects returned by Querying runs; see that section for the per-run fields. The tables below describe the rest of the item: the example fields alongside runs.
get_experiment_results returned experiment results with an examples_with_runs iterator. datasets.experiment_runs.query returns a paginated page object (page.items, page.next_cursor); each item has:

Examples

Query experiment runs and request preview fields

preview=True returned truncated inputs/outputs automatically. In the new API, request that explicitly: pass INPUTS_PREVIEW and OUTPUTS_PREVIEW in selects for the same truncated shape, or INPUTS/OUTPUTS for the untruncated values. Omitting selects returns only id.
Before

Page through results

Both examples below fetch up to 100 results across as many pages as that takes, then stop—so the two are comparable operations, not “one page” vs. “everything.” Adjust the 100/page_size values for your own use case.
get_experiment_results paginates internally and stops once limit total results are returned. datasets.experiment_runs.query has no total-count limit; iterate the returned page with async for and break once you have enough.
Before

Sort by feedback score

Sort dataset examples by a feedback score, supported only when you query a single experiment. In Go and Java, this replaces the legacy sort_params.sort_by/sort_params.sort_order (now sort.by/sort.order); Python and TypeScript gain sorting for the first time in the new API.
get_experiment_results did not support sorting by feedback score.

See also