oai_messages_to_bedrock_messages

oai_messages_to_bedrock_messages(
    messages: list[dict[str, Any]],
    has_tools: bool,
    supports_system_prompts: bool
) -> list[dict[str, Any]]

Convert messages from OAI format to Bedrock format.
We correct for any specific role orders and types, etc.
AWS Bedrock requires messages to alternate between user and assistant roles. This function ensures that the messages are in the correct order and format for Bedrock by inserting “Please continue” messages as needed.
This is the same method as the one in the Autogen Anthropic client

Parameters:
NameDescription
messagesType: list[dict[str, Any]]
has_toolsType: bool
supports_system_promptsType: bool