LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Traceable
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerTraceableJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmithindexClient
Class●Since v0.0

Client

Copy
class Client

Used in Docs

  • Call agents from code
  • Custom instrumentation
  • Dynamic few shot example selection
  • Evaluate a RAG application
  • Evaluate agent performance
(16 more not shown)

Constructors

Properties

Methods

View source on GitHub
constructor
constructor
property
debug: boolean
method
_currentTenantIsOwner
method
_ensureServerInfo
method
_getLatestCommitHash
method
_getPromptUrl
method
_getServerInfo
method
_getSettings
method
_likeOrUnlikePrompt
method
_logEvaluationFeedback→ Promise<[EvaluationResult[], Feedback[]]>
method
_ownerConflictError
method
_selectEvalResults→ EvaluationResult[]
method
addRunsToAnnotationQueue→ Promise<void>
method
awaitPendingTraceBatches→ Promise<void>
method
batchIngestRuns→ Promise<void>
method
cleanup
method
clonePublicDataset→ Promise<void>
method
createAnnotationQueue→ Promise<AnnotationQueueWithDetails>
method
createChatExample→ Promise<Example>
method
createCommit→ Promise<string>
method
createComparativeExperiment→ Promise<ComparativeExperiment>
method
createDataset→ Promise<Dataset>
method
createFeedback→ Promise<Feedback>
method
createFeedbackConfig→ Promise<FeedbackConfigSchema>
method
createLLMExample→ Promise<Example>
method
createPresignedFeedbackToken→ Promise<FeedbackIngestToken>
method
createProject→ Promise<TracerSession>
method
createPrompt→ Promise<Prompt>
method
createRun→ Promise<void>
method
deleteAnnotationQueue→ Promise<void>
method
deleteDataset→ Promise<void>
method
deleteExample→ Promise<void>
method
deleteExamples→ Promise<void>
method
deleteFeedback→ Promise<void>
method
deleteFeedbackConfig→ Promise<void>
method
deleteProject→ Promise<void>
method
deletePrompt→ Promise<void>
method
deleteRunFromAnnotationQueue→ Promise<void>
method
diffDatasetVersions→ Promise<DatasetDiffInfo>
method
flush→ Promise<void>
method
getDatasetUrl→ Promise<string>
method
getHostUrl→ string
method
getProjectUrl→ Promise<string>
method
getPrompt→ Promise<Prompt | null>
method
getRunFromAnnotationQueue→ Promise<RunWithAnnotationQueueInfo>
method
getRunStats→ Promise<any>
method
getRunUrl→ Promise<string>
method
getSizeFromAnnotationQueue→ Promise<__type>
method
hasDataset→ Promise<boolean>
method
hasProject→ Promise<boolean>
method
indexDataset→ Promise<void>
method
likePrompt→ Promise<LikePromptResponse>
method
listAnnotationQueues→ AsyncIterableIterator<AnnotationQueue>
method
listCommits→ AsyncIterableIterator<PromptCommit>
method
listDatasets→ AsyncIterable<Dataset>
method
listDatasetSplits→ Promise<string[]>
method
listExamples→ AsyncIterable<Example>
method
listFeedback→ AsyncIterable<Feedback>
method
listFeedbackConfigs→ AsyncIterableIterator<FeedbackConfigSchema>
method
listGroupRuns→ AsyncIterable<Thread>
method
listPresignedFeedbackTokens→ AsyncIterable<FeedbackIngestToken>
method
listProjects→ AsyncIterable<TracerSessionResult>
method
listPrompts→ AsyncIterableIterator<Prompt>
method
listRuns→ AsyncIterable<Run>
method
listSharedExamples→ Promise<Example[]>
method
listSharedRuns→ Promise<Run[]>
method
logEvaluationFeedback→ Promise<EvaluationResult[]>
method
multipartIngestRuns→ Promise<void>
method
promptExists→ Promise<boolean>
method
pullPromptCommit→ Promise<PromptCommit>
method
pushPrompt→ Promise<string>
method
readAnnotationQueue→ Promise<AnnotationQueueWithDetails>
method
readDataset→ Promise<Dataset>
method
readDatasetOpenaiFinetuning→ Promise<any[]>
method
readDatasetSharedSchema→ Promise<DatasetShareSchema>
method
readDatasetVersion→ Promise<DatasetVersion>
method
readExample→ Promise<Example>
method
readFeedback→ Promise<Feedback>
method
readProject→ Promise<TracerSessionResult>
method
readRun→ Promise<Run>
method
readRunSharedLink→ Promise<string | undefined>
method
readSharedDataset→ Promise<Dataset>
method
shareDataset→ Promise<DatasetShareSchema>
method
shareRun→ Promise<string>
method
similarExamples→ Promise<ExampleSearch[]>
method
unlikePrompt→ Promise<LikePromptResponse>
method
unshareDataset→ Promise<void>
method
unshareRun→ Promise<void>
method
updateAnnotationQueue→ Promise<void>
method
updateDataset→ Promise<Dataset>
method
updateDatasetSplits→ Promise<void>
method
updateDatasetTag→ Promise<void>
method
updateExamples→ Promise<object>
method
updateExamplesMultipart→ Promise<UpdateExamplesResponse>
method
updateFeedback→ Promise<void>
method
updateFeedbackConfig→ Promise<FeedbackConfigSchema>
method
updateProject→ Promise<TracerSession>
method
updatePrompt→ Promise<Record<string, any>>
method
updateRun→ Promise<void>
method
uploadCsv→ Promise<Dataset>
method
getDefaultClientConfig→ __type
deprecatedmethod
createExample→ Promise<Example>
deprecatedmethod
createExamples→ Promise<Example[]>
deprecatedmethod
updateExample→ Promise<object>
deprecatedmethod
uploadExamplesMultipart→ Promise<UploadExamplesResponse>

Add runs to an annotation queue with the specified queue ID.

Awaits all pending trace batches. Useful for environments where you need to be sure that all tracing requests finish before execution ends, such as serverless environments.

Batch ingest/upsert multiple runs in the Langsmith system.

Cleanup resources held by the client. Stops the cache's background refresh timer.

Clone a public dataset to your own langsmith tenant. This operation is idempotent. If you already have a dataset with the given name, this function will do nothing.

Create an annotation queue on the LangSmith API.

Create a feedback configuration on the LangSmith API.

This upserts: if an identical config already exists, it returns it. If a conflicting config exists for the same key, a 400 error is raised.

Creates a presigned feedback token and URL.

The token can be used to authorize feedback metrics without needing an API key. This is useful for giving browser-based applications the ability to submit feedback without needing to expose an API key.

Delete an annotation queue with the specified queue ID.

Delete multiple examples by ID.

Delete a feedback configuration on the LangSmith API.

Delete a run from an an annotation queue.

Flushes current queued traces.

Get a run from an annotation queue at the specified index.

Get the size of an annotation queue.

List the annotation queues on the LangSmith API.

List feedback configurations on the LangSmith API.

Retrieves a list of presigned feedback tokens for a given run ID.

List runs from the LangSmith server.

Get shared examples.

Batch ingest/upsert multiple runs in the Langsmith system.

Read an annotation queue with the specified queue ID.

Get dataset version by closest date or exact tag.

Use this to resolve the nearest version to a given timestamp or for a given tag.

Lets you run a similarity search query on a dataset.

Requires the dataset to be indexed. Please see the indexDataset method to set up indexing.

Update an annotation queue with the specified queue ID.

Update a dataset

Updates a tag on a dataset.

If the tag is already assigned to a different version of this dataset, the tag will be moved to the new version. The as_of parameter is used to determine which version of the dataset to apply the new tags to.

It must be an exact version of the dataset to succeed. You can use the "readDatasetVersion" method to find the exact version to apply the tags to.

Update examples with attachments using multipart form data.

Update a feedback configuration on the LangSmith API.

Upload examples with attachments using multipart form data.