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/corepromptsStructuredPrompt
Class●Since v0.3

StructuredPrompt

Copy
class StructuredPrompt

Bases

ChatPromptTemplate<RunInput, PartialVariableName>

Used in Docs

  • Manage prompts programmatically

Constructors

Properties

Methods

Inherited fromChatPromptTemplate

Properties

PinputVariablesPlc_kwargsPlc_namespacePlc_runnableP
View source on GitHub
lc_serializable
Pmetadata
Pname
PoutputParser
PpartialVariables
PpromptMessages
PPromptValueReturnType
Ptags
PtemplateFormat
PvalidateTemplate
Plc_aliases
Plc_attributes
Plc_id
Plc_secrets
Plc_serializable_keys

Methods

M_batchWithConfigM_callWithConfigM_getOptionsListM_getPromptTypeM_separateRunnableConfigFromCallOptionsM_streamIteratorM_streamLogM_transformStreamWithConfigMassignMasToolMbatchMformatMformatMessagesMformatPromptValueMgetGraphMgetNameMinvokeMmergePartialAndUserVariablesMpartialMpickMpipeMstreamMstreamEventsMstreamLogMtoJSONMtoJSONNotImplementedMtransformMwithConfigMwithFallbacksMwithListenersMwithRetryMfromMessagesMfromTemplateMisRunnableMlc_name

Inherited fromBaseChatPromptTemplate

Properties

PinputVariablesPlc_kwargsPlc_namespacePlc_runnablePlc_serializablePmetadataPnamePoutputParserPpartialVariablesPPromptValueReturnTypePtagsPlc_aliasesPlc_attributesPlc_idPlc_secretsPlc_serializable_keys

Methods

M_batchWithConfigM_callWithConfigM_getOptionsListM_getPromptTypeM_separateRunnableConfigFromCallOptionsM

Inherited fromBasePromptTemplate

Properties

PinputVariablesPlc_kwargsPlc_namespacePlc_runnablePlc_serializablePmetadataPnamePoutputParserPpartialVariablesPPromptValueReturnTypePtagsPlc_aliasesPlc_attributesPlc_idPlc_secretsPlc_serializable_keys

Methods

M_batchWithConfigM_callWithConfigM_getOptionsListM_getPromptTypeM_separateRunnableConfigFromCallOptionsM

Inherited fromRunnable

Properties

Plc_kwargsPlc_namespacePlc_runnablePlc_serializablePnamePlc_aliasesPlc_attributesPlc_idPlc_secretsPlc_serializable_keys

Methods

M_batchWithConfigM_callWithConfigM_getOptionsListM_separateRunnableConfigFromCallOptionsM_streamIteratorM_streamLog

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
method: "jsonMode" | "jsonSchema" | "functionMode"
property
name: string
property
outputParser: BaseOutputParser<unknown>
property
partialVariables: PartialValues<PartialVariableName>
property
promptMessages: BaseMessage<MessageStructure<MessageToolSet>, MessageType> | BaseMessagePromptTemplate<any, BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]>[]
property
PromptValueReturnType: ChatPromptValueInterface
property
schema: Record<string, any>
property
tags: string[]
property
templateFormat: TemplateFormat
property
validateTemplate: boolean
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
formatMessages
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
fromMessages
method
fromMessagesAndSchema
method
fromTemplate
method
isRunnable
method
lc_name

Interface for the input of a ChatPromptTemplate.

_streamIterator
M_streamLog
M_transformStreamWithConfig
Massign
MasTool
Mbatch
Mformat
MformatMessages
MformatPromptValue
MgetGraph
MgetName
Minvoke
MmergePartialAndUserVariables
Mpartial
Mpick
Mpipe
Mstream
MstreamEvents
MstreamLog
MtoJSON
MtoJSONNotImplemented
Mtransform
MwithConfig
MwithFallbacks
MwithListeners
MwithRetry
MisRunnable
Mlc_name
_streamIterator
M_streamLog
M_transformStreamWithConfig
Massign
MasTool
Mbatch
Mformat
MformatPromptValue
MgetGraph
MgetName
Minvoke
MmergePartialAndUserVariables
Mpartial
Mpick
Mpipe
Mstream
MstreamEvents
MstreamLog
MtoJSON
MtoJSONNotImplemented
Mtransform
MwithConfig
MwithFallbacks
MwithListeners
MwithRetry
MisRunnable
Mlc_name
M_transformStreamWithConfig
Massign
MasTool
Mbatch
MgetGraph
MgetName
Minvoke
Mpick
Mpipe
Mstream
MstreamEvents
MstreamLog
MtoJSON
MtoJSONNotImplemented
Mtransform
MwithConfig
MwithFallbacks
MwithListeners
MwithRetry
MisRunnable
Mlc_name