LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangChain
  • Browser
  • Universal
  • Hub
  • Node
  • Load
  • Serializable
  • Encoder Backed
  • File System
  • In Memory
  • Tools
LangChain Core
  • Agents
  • Caches
  • Base
  • Dispatch
  • Web
  • Manager
  • Promises
  • Chat History
  • Context
  • Base
  • Langsmith
  • Documents
  • Embeddings
  • Errors
  • Example Selectors
  • Indexing
  • Base
  • Chat Models
  • Compat
  • Event
  • Llms
  • Openai Completions Stream
  • Profile
  • Stream
  • Structured Output
  • Load
  • Serializable
  • Memory
  • Messages
  • Tool
  • Output Parsers
  • Openai Functions
  • Openai Tools
  • Outputs
  • Prompt Values
  • Prompts
  • Retrievers
  • Document Compressors
  • Runnables
  • Graph
  • Singletons
  • Stores
  • Structured Query
  • Testing
  • Tools
  • Base
  • Console
  • Log Stream
  • Run Collector
  • Tracer Langchain
  • Stream
  • Async Caller
  • Chunk Array
  • Context
  • Env
  • Event Source Parse
  • Format
  • Function Calling
  • Hash
  • Json Patch
  • Json Schema
  • Math
  • Ssrf
  • Standard Schema
  • Stream
  • Testing
  • Tiktoken
  • Types
  • Uuid
  • Vectorstores
Text Splitters
MCP Adapters
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
BrowserUniversalHubNodeLoadSerializableEncoder BackedFile SystemIn MemoryTools
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsCompatEventLlmsOpenai Completions StreamProfileStreamStructured OutputLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryTestingToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingHashJson PatchJson SchemaMathSsrfStandard SchemaStreamTestingTiktokenTypesUuidVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/corepromptsBasePromptTemplate
Class●Since v0.3

BasePromptTemplate

Copy
class BasePromptTemplate

Bases

Runnable<RunInput, RunOutput>

Constructors

Properties

Methods

Inherited fromRunnable

Properties

Plc_kwargsPlc_namespacePlc_runnablePlc_serializablePname
View source on GitHub
P
lc_aliases
Plc_attributes
Plc_id
Plc_secrets
Plc_serializable_keys

Methods

M_batchWithConfigM_callWithConfigM_getOptionsListM_separateRunnableConfigFromCallOptionsM_streamIteratorM_streamLogM_transformStreamWithConfigMassignMasToolMbatchMgetGraphMgetNameMinvokeMpickMpipeMstreamMstreamEventsMstreamLogMtoJSONMtoJSONNotImplementedMtransformMwithConfigMwithFallbacksMwithListenersMwithRetryMisRunnableMlc_name

Inherited fromSerializable

Properties

Plc_kwargsPlc_namespacePlc_serializablePlc_aliasesPlc_attributesPlc_idPlc_secretsPlc_serializable_keys

Methods

MtoJSONMtoJSONNotImplementedMlc_name
constructor
constructor
property
inputVariables: Extract<keyof RunInput, string>[]
property
lc_kwargs: SerializedFields
property
lc_namespace: string[]
property
lc_runnable: boolean
property
lc_serializable: boolean
property
metadata: Record<string, unknown>
property
name: string
property
outputParser: BaseOutputParser<unknown>
property
partialVariables: PartialValues<PartialVariableName>
property
PromptValueReturnType: RunOutput
property
tags: string[]
property
lc_aliases
property
lc_attributes
property
lc_id
property
lc_secrets
property
lc_serializable_keys
method
_batchWithConfig
method
_callWithConfig
method
_getOptionsList
method
_getPromptType
method
_separateRunnableConfigFromCallOptions
method
_streamIterator
method
_streamLog
method
_transformStreamWithConfig
method
assign
method
asTool
method
batch
method
format
method
formatPromptValue
method
getGraph
method
getName
method
invoke
method
mergePartialAndUserVariables
method
partial
method
pick
method
pipe
method
stream
method
streamEvents
method
streamLog
method
toJSON
method
toJSONNotImplemented
method
transform
method
withConfig
method
withFallbacks
method
withListeners
method
withRetry
method
isRunnable
method
lc_name

Base class for prompt templates. Exposes a format method that returns a string prompt given a set of input values.