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

createPrompt

Create a new prompt.

Copy
createPrompt(promptIdentifier: string, options: __type): Promise<Prompt>

Parameters

NameTypeDescription
promptIdentifier*string

The identifier for the new prompt. Can be in the format:

  • "promptName" (creates a private prompt)
  • "owner/promptName" (creates a prompt under a specific owner, must match your tenant)
options__type

Optional configuration for the prompt

Example

Copy
// Create a private prompt
const prompt = await client.createPrompt("my-new-prompt", {
  description: "A prompt for translations",
  tags: ["translation", "language"]
});

// Create a public prompt
const publicPrompt = await client.createPrompt("my-public-prompt", {
  description: "A public translation prompt",
  isPublic: true
});
View source on GitHub