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

langsmith

LangSmith Client.

Attributes

attribute
expect
attribute
version: __version__

Functions

function
aevaluate
function
aevaluate_existing
function
evaluate
function
evaluate_existing
function
get_current_run_tree
function
get_tracing_context
function
set_run_metadata
function
traceable
function
tracing_context
function
configure
function
uuid7
function
uuid7_from_datetime

Classes

class
AsyncClient
class
Client
class
EvaluationResult
class
RunEvaluator
class
AsyncPromptCache
class
PromptCache
class
trace
class
RunTree
class
ContextThreadPoolExecutor

Modules

View source on GitHub
module
anonymizer
module
async_client
module
utils
module
middleware
module
pytest_plugin
module
schemas
module
client
module
run_trees
module
uuid
module
prompt_cache
module
run_helpers
module
testing
module
sandbox
module
evaluation
module
wrappers
module
env

Evaluate an async target system on a given dataset.

Evaluate existing experiment runs asynchronously.

Evaluate a target system on a given dataset.

Evaluate existing experiment runs.

Get the current run tree.

Get the current tracing context.

Update metadata on the current run tree.

Trace a function with langsmith.

Set the tracing context for a block of code.

Configure global LangSmith tracing context.

This function allows you to set global configuration options for LangSmith tracing that will be applied to all subsequent traced operations. It modifies context variables that control tracing behavior across your application.

Do this once at startup to configure the global settings in code.

If, instead, you wish to only configure tracing for a single invocation, use the tracing_context context manager instead.

Generate a random UUID v7.

Generate a UUID v7 from a datetime.

Async Client for interacting with the LangSmith API.

Client for interacting with the LangSmith API.

Evaluation result.

Evaluator interface class.

Thread-safe LRU cache with asyncio task refresh.

For use with the asynchronous AsyncClient.

Features:

  • In-memory LRU cache with configurable max size
  • Asyncio task for refreshing stale entries
  • Stale-while-revalidate: returns stale data while refresh happens
  • Thread-safe for concurrent access

Thread-safe LRU cache with background thread refresh.

For use with the synchronous Client.

Features:

  • In-memory LRU cache with configurable max size
  • Background thread for refreshing stale entries
  • Stale-while-revalidate: returns stale data while refresh happens
  • Thread-safe for concurrent access

Manage a LangSmith run in context.

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

Run Schema with back-references for posting runs.

ThreadPoolExecutor that copies the context to the child thread.

The Async LangSmith Client.

Generic utility functions.

Middleware for making it easier to do distributed tracing.

LangSmith Pytest hooks.

Schemas for the LangSmith API.

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.

Public UUID v7 helpers.

These helpers expose utilities for generating UUID v7 identifiers in user code.

Prompt caching module for LangSmith SDK.

This module provides thread-safe LRU caches with background refresh for prompt caching. Includes both sync and async implementations.

Decorator for creating a run tree from functions.

LangSmith pytest testing module.

LangSmith Sandbox Module.

This module provides sandboxed code execution capabilities through the LangSmith Sandbox API.

Evaluation Helpers.

This module provides convenient tracing wrappers for popular libraries.

Utilities to get information about the runtime environment.