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
Pythonlangsmithrun_helpers
Module●Since v0.0

run_helpers

Decorator for creating a run tree from functions.

Attributes

attribute
LOGGER
attribute
get_run_tree_context: get_current_run_tree
attribute
R
attribute
P
attribute
T

Functions

function
get_current_run_tree

Get the current run tree.

function
set_tracing_parent

Set a RunTree as the active tracing parent within this block.

Unlike tracing_context, this only sets _PARENT_RUN_TREE and nothing else, making it safe to use in isolated threads where you want precise control over which run acts as the parent without inheriting or overwriting other context variables.

function
set_run_metadata

Update metadata on the current run tree.

function
get_tracing_context

Get the current tracing context.

function
tracing_context

Set the tracing context for a block of code.

function
is_traceable_function

Check if a function is @traceable decorated.

function
ensure_traceable

Ensure that a function is traceable.

function
is_async

Inspect function or wrapped function to see if it is async.

function
traceable

Trace a function with langsmith.

function
as_runnable

Convert a function wrapped by the LangSmith @traceable decorator to a Runnable.

Classes

class
WriteReplica

Configuration for a write replica endpoint.

class
LangSmithExtra

Any additional info to be injected into the run dynamically.

class
SupportsLangsmithExtra

Implementations of this Protocol accept an optional langsmith_extra parameter.

class
trace

Manage a LangSmith run in context.

This class can be used as both a synchronous and asynchronous context manager.

Modules

module
ls_client

Client for interacting with the LangSmith API.

Use the client to customize API keys / workspace connections, SSL certs, etc. for tracing.

Also used to create, read, update, and delete LangSmith resources such as runs (~trace spans), datasets, examples (~records), feedback (~metrics), projects (tracer sessions/groups), etc.

For detailed API documentation, visit the LangSmith docs.

module
run_trees

Schemas for the LangSmith API.

module
schemas

Schemas for the LangSmith API.

module
utils

Generic utility functions.

View source on GitHub