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/corepromptsFewShotPromptTemplateInput
Interface●Since v0.3

FewShotPromptTemplateInput

Copy
interface FewShotPromptTemplateInput

Bases

BasePromptTemplateInput<InputValues>

Properties

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
property
examplePrompt: PromptTemplate
property
examples: Example[]
property
exampleSelector: BaseExampleSelector
property
exampleSeparator: string
property
inputVariables: string[]
property
outputParser: BaseOutputParser<unknown>
property
partialVariables: PartialValues<any>
property
prefix: string
property
suffix: string
property
templateFormat: TemplateFormat
property
validateTemplate: boolean

Input common to all prompt templates.

An PromptTemplate used to format a single example.

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

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

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

A list of variable names the prompt template expects

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

Partial variables

A prompt template string to put before the examples.

A prompt template string to put after the examples.

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

Whether or not to try validating the template on initialization.