Prompt template that contains few shot examples.
FewShotPromptTemplate(
self,
**kwargs: Any = {},
)_FewShotPromptTemplateMixinStringPromptTemplateWhether or not to try validating the template.
PromptTemplate used to format an individual example.
A prompt template string to put after the examples.
String separator used to join the prefix, the examples, and suffix.
A prompt template string to put before the examples.
The format of the prompt template.
Options are: 'f-string', 'jinja2'.
Return False as this class is not serializable.
Check that prefix, suffix, and input variables are consistent.
Format the prompt with inputs generating a string.
Use this method to generate a string representation of a prompt.
Async format the prompt with inputs generating a string.
Use this method to generate a string representation of a prompt.
Save the prompt template to a file.
A list of the names of the variables whose values are required as inputs to the
A list of the names of the variables for placeholder or MessagePlaceholder that
A dictionary of the types of the variables the prompt template expects.
How to parse the output of calling an LLM on this formatted prompt.
A dictionary of the partial variables the prompt template carries.
Metadata to be used for tracing.
Tags to be used for tracing.
Return the output type of the prompt.
Validate variable names do not include restricted names.
Get the namespace of the LangChain object.
Get the input schema for the prompt.
Invoke the prompt.
Async invoke the prompt.
Create PromptValue.
Async create PromptValue.
Return a partial of the prompt template.
Return dictionary representation of prompt.
The name of the Runnable. Used for debugging and tracing.
Input type.
Output Type.
The type of input this Runnable accepts specified as a Pydantic model.
Output schema.
List configurable fields for this Runnable.
Get the name of the Runnable.
Get a Pydantic model that can be used to validate input to the Runnable.
Get a JSON schema that represents the input to the Runnable.
Get a Pydantic model that can be used to validate output to the Runnable.
Get a JSON schema that represents the output of the Runnable.
The type of config this Runnable accepts specified as a Pydantic model.
Get a JSON schema that represents the config of the Runnable.
Return a graph representation of this Runnable.
Return a list of prompts used by this Runnable.
Pipe Runnable objects.
Pick keys from the output dict of this Runnable.
Assigns new fields to the dict output of this Runnable.
Transform a single input into an output.
Transform a single input into an output.
Default implementation runs invoke in parallel using a thread pool executor.
Run invoke in parallel on a list of inputs.
Default implementation runs ainvoke in parallel using asyncio.gather.
Run ainvoke in parallel on a list of inputs.
Default implementation of stream, which calls invoke.
Default implementation of astream, which calls ainvoke.
Stream all output from a Runnable, as reported to the callback system.
Generate a stream of events.
Transform inputs to outputs.
Transform inputs to outputs.
Bind arguments to a Runnable, returning a new Runnable.
Bind config to a Runnable, returning a new Runnable.
Bind lifecycle listeners to a Runnable, returning a new Runnable.
Bind async lifecycle listeners to a Runnable.
Bind input and output types to a Runnable, returning a new Runnable.
Create a new Runnable that retries the original Runnable on exceptions.
Return a new Runnable that maps a list of inputs to a list of outputs.
Add fallbacks to a Runnable, returning a new Runnable.
Create a BaseTool from a Runnable.