> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ag2.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.oai.bedrock.oai_messages_to_bedrock_messages

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### oai\_messages\_to\_bedrock\_messages

```python theme={null}
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.<br />We correct for any specific role orders and types, etc.<br />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.<br />This is the same method as the one in the Autogen Anthropic client

<b>Parameters:</b>

| Name                      | Description                      |
| ------------------------- | -------------------------------- |
| `messages`                | **Type:** list\[dict\[str, Any]] |
| `has_tools`               | **Type:** bool                   |
| `supports_system_prompts` | **Type:** bool                   |

<br />
