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]): 要组合的BaseMessage列表。 human_prompt (str, 可选): 人类提示标签。默认为“
- Human:”.
ai_prompt (str, 可选): AI 提示标签。默认为“
- Assistant:”.
- Returns:
str: 包含必要 human_prompt 和 ai_prompt 标签的组合字符串。
- Parameters:
messages (List[BaseMessage])
human_prompt (str)
ai_prompt (str)
- Return type:
字符串