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
Pythonlangsmith_openapi_clienttypesthreadThread
Class●Since v0.10

Thread

Copy
Thread()

Bases

BaseModel

Attributes

Inherited fromBaseModel

Attributes

Amodel_fields_set: set[str]Amodel_config: ConfigDictAmodel_construct: construct

Methods

Mto_dict
—
View source on GitHub

Recursively generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Mto_json
—

Generates a JSON string representing this model as it would be received from or sent to the API (but with indentation).

Mconstruct
Mmodel_dump
—

Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump

Mmodel_dump_json
—

Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json

Classes

CConfig
attribute
count: Optional[int]
attribute
feedback_stats: Optional[Dict[str, FeedbackStats]]
attribute
first_inputs: Optional[str]
attribute
first_trace_id: Optional[str]
attribute
last_error: Optional[str]
attribute
last_outputs: Optional[str]
attribute
last_trace_id: Optional[str]
attribute
latency_p50: Optional[float]
attribute
latency_p99: Optional[float]
attribute
max_start_time: Optional[datetime]
attribute
min_start_time: Optional[datetime]
attribute
num_errored_turns: Optional[int]
attribute
start_time: Optional[datetime]
attribute
thread_id: Optional[str]
attribute
total_cost: Optional[float]
attribute
total_cost_details: Optional[Dict[str, float]]
attribute
total_token_details: Optional[Dict[str, int]]
attribute
total_tokens: Optional[int]
attribute
trace_id: Optional[str]

count is how many root traces (conversation turns) fall in this thread for the query time range.

feedback_stats is the aggregated feedback across traces in the thread, keyed by feedback key; shape matches feedback_stats on a single run.

first_inputs is a truncated preview of inputs from the earliest trace in the thread for the query window.

first_trace_id is the root trace UUID for the chronologically first trace in the query time window.

last_error is a short error summary from the most recent failing trace in the thread. Absent when there is no error in the window.

last_outputs is a truncated preview of outputs from the latest trace in the thread for the query window.

last_trace_id is the root trace UUID for the chronologically last trace in the query time window.

latency_p50 is the approximate median end-to-end latency of traces in the thread, in seconds.

latency_p99 is the approximate 99th percentile end-to-end latency of traces in the thread, in seconds.

max_start_time is the latest trace start time in the thread (RFC3339 date-time).

min_start_time is the earliest trace start time in the thread (RFC3339 date-time).

num_errored_turns is the count of root traces in the thread (within the query window) whose status was an error.

start_time is a reference start time for this row (RFC3339 date-time), such as for sorting.

thread_id identifies this conversation thread within the project from the request body project_id.

total_cost is the sum of estimated USD cost across those traces.

total_cost_details sums per-category estimated USD cost across traces in the thread. Keys mirror total_token_details.

Example: {"cache_read": 0.012, "reasoning": 0.008}.

total_token_details sums per-category token counts across traces in the thread.

Keys are model-specific category names (for example cache_read, cache_write, reasoning, audio).

Example: {"cache_read": 400, "reasoning": 120}.

total_tokens is the sum of token usage across those traces.

trace_id is a representative root trace UUID when the summary includes one, for example for deep links.