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
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
function
set_tracing_parent
function
set_run_metadata
function
get_tracing_context
function
tracing_context
function
is_traceable_function
function
ensure_traceable
function
is_async
function
traceable
function
as_runnable

Classes

class
WriteReplica
class
LangSmithExtra
class
SupportsLangsmithExtra
class
trace

Modules

View source on GitHub
module
ls_client
module
run_trees
module
schemas
module
utils

Get the current run tree.

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.

Update metadata on the current run tree.

Get the current tracing context.

Set the tracing context for a block of code.

Check if a function is @traceable decorated.

Ensure that a function is traceable.

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

Trace a function with langsmith.

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

Configuration for a write replica endpoint.

Any additional info to be injected into the run dynamically.

Implementations of this Protocol accept an optional langsmith_extra parameter.

Manage a LangSmith run in context.

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

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.

Schemas for the LangSmith API.

Schemas for the LangSmith API.

Generic utility functions.