BaseMessagePromptTemplate#

class langchain_core.prompts.chat.BaseMessagePromptTemplate[source]#

Bases: Serializable, ABC

Base class for message prompt templates.

async aformat_messages(**kwargs: Any) List[BaseMessage][source]#

Async format messages from kwargs. Should return a list of BaseMessages.

Parameters:

**kwargs (Any) – Keyword arguments to use for formatting.

Returns:

List of BaseMessages.

Return type:

List[BaseMessage]

abstract format_messages(**kwargs: Any) List[BaseMessage][source]#

Format messages from kwargs. Should return a list of BaseMessages.

Parameters:

**kwargs (Any) – Keyword arguments to use for formatting.

Returns:

List of BaseMessages.

Return type:

List[BaseMessage]

pretty_print() None[source]#

Print a human-readable representation.

Return type:

None

pretty_repr(html: bool = False) str[source]#

Human-readable representation.

Parameters:

html (bool) – Whether to format as HTML. Defaults to False.

Returns:

Human-readable representation.

Return type:

str

abstract property input_variables: List[str]#

Input variables for this prompt template.

Returns:

List of input variables.