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
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmithclientClientlistCommits
Method●Since v0.1

listCommits

List all commits for a prompt.

Copy
listCommits(promptIdentifier: string): AsyncIterableIterator<PromptCommit>

Parameters

NameTypeDescription
promptIdentifier*string

The identifier of the prompt. Can be in the format:

  • "promptName" (for private prompts, owner defaults to "-")
  • "owner/promptName" (for prompts with explicit owner)
  • "promptName:commitHash" (commit hash is ignored, all commits are returned)

Example

Copy
// List commits for a private prompt
for await (const commit of client.listCommits("my-prompt")) {
  console.log(commit);
}

// List commits for a prompt with explicit owner
for await (const commit of client.listCommits("owner/my-prompt")) {
  console.log(commit);
}
View source on GitHub