ChatPromptAdapter#
- class langchain_aws.chat_models.bedrock.ChatPromptAdapter[源代码]#
适配器类,用于将Langchain的输入准备成Chat模型期望的提示格式。
方法
convert_messages_to_prompt
(provider, ...)format_messages
(provider, messages)- classmethod convert_messages_to_prompt(provider: str, messages: List[BaseMessage], model: str) str [source]#
- Parameters:
provider (str)
messages (List[BaseMessage])
model (str)
- Return type:
字符串
- classmethod format_messages(provider: str, messages: List[BaseMessage]) Tuple[str | None, List[Dict]] [source]#
- Parameters:
provider (str)
messages (List[BaseMessage])
- Return type:
元组[str | None, 列表[字典]]