Prompt values for language model prompts.
Prompt values are used to represent different pieces of prompts. They can be used to represent text, images, or chat message pieces.
Serializable base class.
This class is used to serialize objects to JSON.
It relies on the following methods and properties:
is_lc_serializable: Is this class serializable?
By design, even if a class inherits from Serializable, it is not serializable
by default. This is to prevent accidental serialization of objects that should
not be serialized.
get_lc_namespace: Get the namespace of the LangChain object.
During deserialization, this namespace is used to identify the correct class to instantiate.
Please see the Reviver class in langchain_core.load.load for more details.
During deserialization an additional mapping is handle classes that have moved or been renamed across package versions.
lc_secrets: A map of constructor argument names to secret ids.
lc_attributes: List of additional attribute names that should be included
as part of the serialized representation.
Base abstract message class.
Messages are the inputs and outputs of a chat model.
Examples include HumanMessage,
AIMessage, and
SystemMessage.
Message from the user.
A HumanMessage is a message that is passed in from a user to the model.
Base abstract class for inputs to any language model.
PromptValues can be converted to both LLM (pure text-generation) inputs and
chat model inputs.
String prompt value.
Chat prompt value.
A type of a prompt value that is built from messages.
Image URL for multimodal model inputs (OpenAI format).
Represents the inner image_url object in OpenAI's Chat Completion API format. This
is used by ImagePromptTemplate and ChatPromptTemplate.
Image prompt value.
Chat prompt value which explicitly lists out the message types it accepts.
For use in external schemas.