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
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmithtypesthread_aggregate_stats_paramsThreadAggregateStatsParams
Class●Since v0.14

ThreadAggregateStatsParams

Copy
ThreadAggregateStatsParams()

Bases

TypedDict

Constructors

Attributes

View source on GitHub
constructor
__init__
NameType
project_idRequired[str]
selectRequired[List[Literal['THREAD_COUNT', 'TRACE_COUNT', 'TOTAL_TOKENS', 'TOTAL_COST', 'ERROR_RATE', 'STREAMING_RATE', 'LATENCY_P50', 'LATENCY_P99', 'MEDIAN_TOKENS', 'FIRST_TOKEN_P50', 'FIRST_TOKEN_P99', 'PROMPT_TOKENS', 'COMPLETION_TOKENS', 'PROMPT_COST', 'COMPLETION_COST', 'PROMPT_TOKEN_DETAILS', 'COMPLETION_TOKEN_DETAILS', 'PROMPT_COST_DETAILS', 'COMPLETION_COST_DETAILS', 'THREAD_FEEDBACK_STATS']]]
filterstr
max_start_timeAnnotated[Union[str, datetime], PropertyInfo(format='iso8601')]
min_start_timeAnnotated[Union[str, datetime], PropertyInfo(format='iso8601')]
thread_filterstr
trace_filterstr
tree_filterstr
attribute
project_id: Required[str]

project_id is the tracing project UUID.

attribute
select: Required[List[Literal['THREAD_COUNT', 'TRACE_COUNT', 'TOTAL_TOKENS', 'TOTAL_COST', 'ERROR_RATE', 'STREAMING_RATE', 'LATENCY_P50', 'LATENCY_P99', 'MEDIAN_TOKENS', 'FIRST_TOKEN_P50', 'FIRST_TOKEN_P99', 'PROMPT_TOKENS', 'COMPLETION_TOKENS', 'PROMPT_COST', 'COMPLETION_COST', 'PROMPT_TOKEN_DETAILS', 'COMPLETION_TOKEN_DETAILS', 'PROMPT_COST_DETAILS', 'COMPLETION_COST_DETAILS', 'THREAD_FEEDBACK_STATS']]]

select lists the aggregate statistics to compute and return.

At least one value is required.

attribute
filter: str

filter is a deprecated, unscoped LangSmith filter expression evaluated against trace root runs. Kept for compatibility with deployments that serve this endpoint via the legacy ClickHouse backend (no SmithDB query service configured); prefer trace_filter, tree_filter, or thread_filter otherwise, since those require SmithDB.

attribute
max_start_time: Annotated[Union[str, datetime], PropertyInfo(format='iso8601')]

max_start_time is the exclusive upper bound on thread activity (RFC3339 date-time). Defaults to now (UTC) when omitted.

attribute
min_start_time: Annotated[Union[str, datetime], PropertyInfo(format='iso8601')]

min_start_time is the inclusive lower bound on thread activity (RFC3339 date-time). Defaults to 1 day before now (UTC) when omitted.

attribute
thread_filter: str

thread_filter narrows eligible threads using a LangSmith filter expression evaluated against the complete thread summary.

attribute
trace_filter: str

trace_filter narrows eligible threads to those containing a trace whose root run matches this LangSmith filter expression.

attribute
tree_filter: str

tree_filter narrows eligible threads to those containing a matching run anywhere in a trace tree.