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

close

Copy
close(
    self,
    timeout: Optional[float] = None,
) -> None
View source on GitHub

Parameters

NameTypeDescription
timeoutOptional[float]
Default:None

Forwarded to :meth:cleanup / :meth:flush. Maximum seconds to wait for pending traces to flush. None (default) waits indefinitely. Pass 0 to skip the drain.

Release resources held by this client.

Calls :meth:cleanup to drain pending traces and stop background threads, then closes the underlying requests.Session and unregisters the atexit handler so the session is not pinned in memory for the remainder of the process lifetime.

Safe to call multiple times.