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
JavaScriptlangsmithclientClientgetPrompt
Method●Since v0.1

getPrompt

Get a prompt by its identifier.

Copy
getPrompt(promptIdentifier: string): Promise<Prompt | null>

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, latest version is returned)

Example

Copy
// Get a private prompt
const prompt = await client.getPrompt("my-prompt");

// Get a public prompt
const publicPrompt = await client.getPrompt("owner/public-prompt");
View source on GitHub