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
Pythonlangsmith_clientLangsmith
Class●Since v0.14

Langsmith

Copy
Langsmith(
  self,
  *,
  api_key: str | None = None,
  tenant_id: str | None = None

Bases

SyncAPIClient

Constructors

Attributes

Methods

Inherited fromSyncAPIClient

Methods

Mis_closedMclose
—

Close the response and release the connection.

MrequestMgetM
View source on GitHub
,
base_url
:
str
|
httpx
.
URL
|
None
=
None
,
timeout
:
float
|
Timeout
|
None
|
NotGiven
=
not_given
,
max_retries
:
int
=
DEFAULT_MAX_RETRIES
,
default_headers
:
Mapping
[
str
,
str
]
|
None
=
None
,
default_query
:
Mapping
[
str
,
object
]
|
None
=
None
,
http_client
:
httpx
.
Client
|
None
=
None
,
_strict_response_validation
:
bool
=
False
)
post
—

Post the run tree to the API asynchronously.

Mpatch
—

Patch the run tree to the API in a background thread.

Mput
Mdelete
Mget_api_list

Inherited fromBaseClient

Attributes

Amax_retries: intAtimeout: float | Timeout | NoneAcustom_auth: httpx.Auth | NoneAdefault_query: dict[str, object]Auser_agent: strAbase_url: URL

Methods

Mplatform_headers
constructor
__init__
NameType
api_keystr | None
tenant_idstr | None
base_urlstr | httpx.URL | None
timeoutfloat | Timeout | None | NotGiven
max_retriesint
default_headersMapping[str, str] | None
default_queryMapping[str, object] | None
http_clienthttpx.Client | None
_strict_response_validationbool
attribute
api_key: str | None
attribute
tenant_id: str | None
attribute
qs: Querystring
attribute
auth_headers: dict[str, str]
attribute
default_headers: dict[str, str | Omit]
attribute
with_options: copy
method
product_feedback
method
fleet
method
sessions
method
datasets
method
runs
method
threads
method
traces
method
online_evaluators
method
public
method
annotation_queues
method
prompt_webhooks
method
info
method
issues
method
sandboxes
method
with_raw_response
method
with_streaming_response
method
copy

Create a new client instance re-using the same options given to the current client with optional overriding.