LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
PythonlangsmithclientClientget_run_stats
Method●Since v0.1

get_run_stats

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.

Copy
get_run_stats(
  self,
  *,
  id: Optional[list[ID_TYPE]] = None,
  trace: Optional[ID_TYPE] = None,
  parent_run: Optional[ID_TYPE] = None,
  run_type: Optional[str] = None,
  project_names: Optional[list[str]] = None,
  project_ids: Optional[list[ID_TYPE]] = None,
  reference_example_ids: Optional[list[ID_TYPE]] = None,
  start_time: Optional[str] = None,
  end_time: Optional[str] = None,
  error: Optional[bool] = None,
  query: Optional[str] = None,
  filter: Optional[str] = None,
  trace_filter: Optional[str] = None,
  tree_filter: Optional[str] = None,
  is_root: Optional[bool] = None,
  data_source_type: Optional[str] = None
) -> dict[str, Any]

Parameters

NameTypeDescription
idOptional[List[Union[UUID, str]]]
Default:None

List of run IDs to filter by.

traceOptional[Union[UUID, str]]
Default:None

Trace ID to filter by.

parent_runOptional[Union[UUID, str]]
Default:None

Parent run ID to filter by.

run_typeOptional[str]
Default:None

Run type to filter by.

project_namesOptional[List[str]]
Default:None

List of project names to filter by.

project_idsOptional[List[Union[UUID, str]]]
Default:None

List of project IDs to filter by.

reference_example_idsOptional[List[Union[UUID, str]]]
Default:None

List of reference example IDs to filter by.

start_timeOptional[str]
Default:None

Start time to filter by.

end_timeOptional[str]
Default:None

End time to filter by.

errorOptional[bool]
Default:None

Filter by error status.

queryOptional[str]
Default:None

Query string to filter by.

filterOptional[str]
Default:None

Filter string to apply.

trace_filterOptional[str]
Default:None

Trace filter string to apply.

tree_filterOptional[str]
Default:None

Tree filter string to apply.

is_rootOptional[bool]
Default:None

Filter by root run status.

data_source_typeOptional[str]
Default:None

Data source type to filter by.

View source on GitHub