langsmith.client.Client.get_run_stats#

Client.get_run_stats(*, id: List[UUID | str] | None = None, trace: UUID | str | None = None, parent_run: UUID | str | None = None, run_type: str | None = None, project_names: List[str] | None = None, project_ids: List[UUID | str] | None = None, reference_example_ids: List[UUID | str] | None = None, start_time: str | None = None, end_time: str | None = None, error: bool | None = None, query: str | None = None, filter: str | None = None, trace_filter: str | None = None, tree_filter: str | None = None, is_root: bool | None = None, data_source_type: str | None = None) Dict[str, Any][source]#

Get aggregate statistics over queried runs.

Takes in similar query parameters to list_runs and returns statistics based on the runs that match the query.

Parameters:
  • id (Optional[List[ID_TYPE]]) – List of run IDs to filter by.

  • trace (Optional[ID_TYPE]) – Trace ID to filter by.

  • parent_run (Optional[ID_TYPE]) – Parent run ID to filter by.

  • run_type (Optional[str]) – Run type to filter by.

  • projects (Optional[List[ID_TYPE]]) – List of session IDs to filter by.

  • reference_example (Optional[List[ID_TYPE]]) – List of reference example IDs to filter by.

  • start_time (Optional[str]) – Start time to filter by.

  • end_time (Optional[str]) – End time to filter by.

  • error (Optional[bool]) – Filter by error status.

  • query (Optional[str]) – Query string to filter by.

  • filter (Optional[str]) – Filter string to apply.

  • trace_filter (Optional[str]) – Trace filter string to apply.

  • tree_filter (Optional[str]) – Tree filter string to apply.

  • is_root (Optional[bool]) – Filter by root run status.

  • data_source_type (Optional[str]) – Data source type to filter by.

  • project_names (List[str] | None) –

  • project_ids (List[UUID | str] | None) –

  • reference_example_ids (List[UUID | str] | None) –

Returns:

A dictionary containing the run statistics.

Return type:

Dict[str, Any]