Async Client for interacting with the LangSmith API.
| Name | Type | Description |
|---|---|---|
api_url | Optional[str] | Default: NoneURL for the LangSmith API. |
api_key | Optional[str] | Default: NoneAPI key for the LangSmith API. |
timeout_ms | Optional[Union[int, tuple[Optional[int], Optional[int], Optional[int], Optional[int]]]] | Default: None |
retry_config | Optional[Mapping[str, Any]] | Default: None |
web_url | Optional[str] | Default: None |
headers | Optional[dict[str, str]] | Default: None |
workspace_id | Optional[str] | Default: None |
disable_prompt_cache | bool | Default: False |
cache | Optional[Union[bool, AsyncPromptCache]] | Default: None |
| Name | Type |
|---|---|
| api_url | Optional[str] |
| api_key | Optional[str] |
| timeout_ms | Optional[Union[int, tuple[Optional[int], Optional[int], Optional[int], Optional[int]]]] |
| retry_config | Optional[Mapping[str, Any]] |
| web_url | Optional[str] |
| headers | Optional[dict[str, str]] |
| workspace_id | Optional[str] |
| disable_prompt_cache | bool |
| cache | Optional[Union[bool, AsyncPromptCache]] |
Add runs to an annotation queue with the specified queue_id.
Provide exactly one of runs or run_ids:
runs (preferred): each entry carries the run's full lookup key
(run_id, session_id, start_time, and an optional
source_proposed_example_id). This lets the run be located directly,
without a scan, and is required for workspaces served by SmithDB.run_ids: a plain list of run IDs. This path is deprecated and will
be removed after Jan 31, 2027; prefer runs.
See https://docs.langchain.com/langsmith/smithdb-sdk-migration#annotation-queues-add-runs.Create a new prompt.
Does not attach prompt object, just creates an empty prompt.
Pull a prompt and return it as a LangChain PromptTemplate.
This method requires langchain-core.
Timeout for requests in milliseconds.
Retry configuration.
URL for the LangSmith web app.
Additional HTTP headers to include in all requests.
These headers will be merged with the default headers (Content-Type, x-api-key, etc.). Custom headers will not override the default required headers.
The workspace ID. Required for org-scoped API keys.
Disable prompt caching for this client.
[Deprecated] Control prompt caching behavior.
This parameter is deprecated. Use configure_global_async_prompt_cache() to
configure caching, or disable_prompt_cache=True to disable it.
True: Enable caching with the global singletonFalse: Disable caching (equivalent to disable_prompt_cache=True)AsyncCache(...)/AsyncPromptCache(...): Use a custom cache instance