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
PythonlangsmithclientClientlist_threads
Method●Since v0.7

list_threads

List threads and fetch the runs for each thread.

Copy
list_threads(
  self,
  *,
  project_id: Optional[ID_TYPE] = None,
  project_name: Optional[str] = None,
  limit: Optional[int] = None,
  offset: int = 0,
  filter: Optional[str] = None,
  start_time: Optional[datetime.datetime] = None
) -> list[ListThreadsItem]

Parameters

NameTypeDescription
project_idOptional[ID_TYPE]
Default:None

The project (session) id.

project_nameOptional[str]
Default:None

The project name (alternative to project_id).

limitOptional[int]
Default:None

Maximum number of threads to return. Default None (no limit).

offsetint
Default:0

Pagination offset for threads. Default 0.

filterOptional[str]
Default:None

Optional filter for threads and runs.

start_timeOptional[datetime.datetime]
Default:None

Only include runs from this time. Default: 1 day ago.

View source on GitHub