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
PythonlangsmithUtilities

Utilities

Classes

Class

LangSmithError

An error occurred while communicating with the LangSmith API.

Class

LangSmithAPIError

Internal server error while communicating with LangSmith.

Class

LangSmithRequestTimeout

Client took too long to send request body.

Class

LangSmithUserError

User error caused an exception when communicating with LangSmith.

Class

LangSmithRateLimitError

You have exceeded the rate limit for the LangSmith API.

Class

LangSmithAuthError

Couldn't authenticate with the LangSmith API.

Class

LangSmithNotFoundError

Couldn't find the requested resource.

Class

LangSmithConflictError

The resource already exists.

Class

LangSmithConnectionError

Couldn't connect to the LangSmith API.

Class

LangSmithExceptionGroup

Port of ExceptionGroup for Py < 3.11.

Class

LangSmithWarning

Base class for warnings.

Class

LangSmithMissingAPIKeyWarning

Warning for missing API key.

Class

FilterPoolFullWarning

Filter urllib3 warnings logged when the connection pool isn't reused.

Class

FilterLangSmithRetry

Filter for retries from this lib.

Class

LangSmithRetry

Wrapper to filter logs with this name.

Class

ContextThreadPoolExecutor

ThreadPoolExecutor that copies the context to the child thread.

Functions

Function

tracing_is_enabled

Return True if tracing is enabled.

Function

test_tracking_is_disabled

Return True if testing is enabled.

Function

xor_args

Validate specified keyword args are mutually exclusive.

Function

raise_for_status_with_text

Raise an error with the response text.

Function

get_enum_value

Get the value of a string enum.

Function

log_once

Log a message at the specified level, but only once.

Function

get_messages_from_inputs

Extract messages from the given inputs dictionary.

Function

get_message_generation_from_outputs

Retrieve the message generation from the given outputs.

Function

get_prompt_from_inputs

Retrieve the prompt from the given inputs.

Function

get_llm_generation_from_outputs

Get the LLM generation from the outputs.

Function

get_docker_compose_command

Get the correct docker compose command for this system.

Function

convert_langchain_message

Convert a LangChain message to an example.

Function

is_base_message_like

Check if the given object is similar to BaseMessage.

Function

is_env_var_truish

Check if the given environment variable is truish.

Function

get_env_var

Retrieve an environment variable from a list of namespaces.

Function

get_tracer_project

Get the project name for a LangSmith tracer.

Function

filter_logs

Temporarily adds specified filters to a logger.

Function

get_cache_dir

Get the testing cache directory.

Function

filter_request_headers

Filter request headers based on ignore_hosts and allow_hosts.

Function

with_cache

Use a cache for requests.

Function

with_optional_cache

Use a cache for requests.

Function

deepish_copy

Deep copy a value with a compromise for uncopyable objects.

Function

is_version_greater_or_equal

Check if the current version is greater or equal to the target version.

Function

parse_prompt_identifier

Parse a string in the format of owner/name:hash, name:hash, owner/name, or name.

Function

get_api_url

Get the LangSmith API URL from the environment or the given value.

Function

get_api_key

Get the API key from the environment or the given value.

Function

get_workspace_id

Get workspace ID.

Function

get_host_url

Get the host URL based on the web URL or API URL.

Function

is_truish

Check if the value is truish.

Constants

Attribute

T

Attribute

P