prompts
#
Prompt is the input to the model.
Prompt is often constructed from multiple components and prompt values. Prompt classes and functions make constructing
and working with prompts easy.
Class hierarchy:
BasePromptTemplate --> PipelinePromptTemplate
StringPromptTemplate --> PromptTemplate
FewShotPromptTemplate
FewShotPromptWithTemplates
BaseChatPromptTemplate --> AutoGPTPrompt
ChatPromptTemplate --> AgentScratchPadChatPromptTemplate
BaseMessagePromptTemplate --> MessagesPlaceholder
BaseStringMessagePromptTemplate --> ChatMessagePromptTemplate
HumanMessagePromptTemplate
AIMessagePromptTemplate
SystemMessagePromptTemplate
Classes
Base class for all prompt templates, returning a prompt. |
|
AI message prompt template. |
|
Base class for chat prompt templates. |
|
Base class for message prompt templates. |
|
Base class for message prompt templates that use a string prompt template. |
|
Chat message prompt template. |
|
Prompt template for chat models. |
|
Human message prompt template. |
|
Prompt template that assumes variable is already list of messages. |
|
System message prompt template. |
|
Chat prompt template that supports few-shot examples. |
|
Prompt template that contains few shot examples. |
|
Prompt template that contains few shot examples. |
|
Image prompt template for a multimodal model. |
|
Prompt template for composing multiple prompt templates together. |
|
Prompt template for a language model. |
|
String prompt that exposes the format method, returning a prompt. |
|
Functions
|
Async format a document into a string based on a prompt template. |
|
Format a document into a string based on a prompt template. |
|
Unified method for loading a prompt from LangChainHub or local fs. |
Load prompt from Config Dict. |
|
Check that template string is valid. |
|
Get the variables from the template. |
|
|
Format a template using jinja2. |
|
Format a template using mustache. |
|
Get the variables from a mustache template. |
|
Get the variables from a mustache template. |
|
Validate that the input variables are valid for the template. |