langchain_community.chat_models.anthropic
.convert_messages_to_prompt_anthropicΒΆ
- langchain_community.chat_models.anthropic.convert_messages_to_prompt_anthropic(messages: List[BaseMessage], *, human_prompt: str = '\n\nHuman:', ai_prompt: str = '\n\nAssistant:') str [source]ΒΆ
- Format a list of messages into a full prompt for the Anthropic model
- Args:
messages (List[BaseMessage]): List of BaseMessage to combine. human_prompt (str, optional): Human prompt tag. Defaults to β
- Human:β.
ai_prompt (str, optional): AI prompt tag. Defaults to β
- Assistant:β.
- Returns:
str: Combined string with necessary human_prompt and ai_prompt tags.
- Parameters
messages (List[BaseMessage]) β
human_prompt (str) β
ai_prompt (str) β
- Return type
str