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
  • Gateway
  • 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 CallingGatewayHashJson PatchJson SchemaMathSsrfStandard SchemaStreamTestingTiktokenTypesUuidVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/corepromptsFewShotChatMessagePromptTemplateInput
Interface●Since v0.3

FewShotChatMessagePromptTemplateInput

Input common to all prompt templates.

Copy
interface FewShotChatMessagePromptTemplateInput

Bases

BasePromptTemplateInput<InputValues>

Properties

property
examplePrompt: BaseMessagePromptTemplate<any, BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]> | BaseChatPromptTemplate<any, any>

An BaseMessagePromptTemplate | BaseChatPromptTemplate used to format a single example.

property
examples: Example[]

Examples to format into the prompt. Exactly one of this or exampleSelector must be provided.

property
exampleSelector: BaseExampleSelector

An BaseExampleSelector Examples to format into the prompt. Exactly one of this or examples must be provided.

property
exampleSeparator: string

String separator used to join the prefix, the examples, and suffix.

property
inputVariables: string[]

A list of variable names the prompt template expects

property
outputParser: BaseOutputParser<unknown>

How to parse the output of calling an LLM on this formatted prompt

property
partialVariables: PartialValues<any>

Partial variables

property
prefix: string

A prompt template string to put before the examples.

property
suffix: string

A prompt template string to put after the examples.

property
templateFormat: TemplateFormat

The format of the prompt template. Options are: 'f-string'

property
validateTemplate: boolean

Whether or not to try validating the template on initialization.

Inherited fromBasePromptTemplateInput

Properties

PinputVariables: Extract<keyof InputVariables, string>[]
—

A list of variable names the prompt template expects

PoutputParser: BaseOutputParser<unknown>
—

How to parse the output of calling an LLM on this formatted prompt

PpartialVariables: PartialValues<PartialVariableName>
—

Partial variables

View source on GitHub