MCPcopy
hub / github.com/langchain-ai/langchain / append

Method append

libs/core/langchain_core/prompts/chat.py:1108–1114  ·  libs/core/langchain_core/prompts/chat.py::ChatPromptTemplate.append

Append message to the end of the chat template. Args: message: representation of a message to append.

(self, message: MessageLikeRepresentation)

Source from the content-addressed store, hash-verified

1106 return type(self)(**prompt_dict)
1107
1108 def append(self, message: MessageLikeRepresentation) -> None:
1109 class="st">"""Append message to the end of the chat template.
1110
1111 Args:
1112 message: representation of a message to append.
1113 class="st">"""
1114 self.messages.append(_convert_to_message(message))
1115
1116 def extend(self, messages: Sequence[MessageLikeRepresentation]) -> None:
1117 class="st">""class="st">"Extend the chat template with a sequence of messages."class="st">""

Callers 15

_format_chat_historyFunction · 0.80
format_messagesFunction · 0.80
generate_img_summariesFunction · 0.80
get_images_from_pdfFunction · 0.80
get_resized_imagesFunction · 0.80
img_prompt_funcFunction · 0.80
_format_chat_historyFunction · 0.80
create_promptFunction · 0.80
chain.pyFile · 0.80
generate_img_summariesFunction · 0.80
get_images_from_pdfFunction · 0.80
get_resized_imagesFunction · 0.80

Calls 1

_convert_to_messageFunction · 0.70

Tested by 15

_persist_runMethod · 0.64
_persist_runMethod · 0.64
mock_create_runMethod · 0.64
_persist_runMethod · 0.64
add_messageMethod · 0.64
test_chain_orderingFunction · 0.64
add_messageMethod · 0.64
_get_postsFunction · 0.64
test_chain_orderingFunction · 0.64
add_messageMethod · 0.64