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

# bedrock.Client

> Bedrock client implementation for API interactions and model integration.

[View module source on GitHub](https://github.com/maximhq/maxim-py/blob/main/maxim/logger/bedrock/client.py)

## [MaximBedrockClient](/sdk/python/references/logger/bedrock/client)

```python theme={null}
class MaximBedrockClient()
```

[Maxim](/sdk/python/references/maxim) Bedrock client wrapper.

This class provides a wrapper around the Bedrock client to integrate
with [Maxim](/sdk/python/references/maxim)'s logging and monitoring capabilities. It allows tracking
and logging of Bedrock API interactions through the [Maxim](/sdk/python/references/maxim) platform.

#### \_\_init\_\_

```python theme={null}
def __init__(logger: Logger, client: BaseClient)
```

Initialize the [Maxim](/sdk/python/references/maxim) Bedrock client.

**Arguments**:

| Name     | Type                                             | Description                                                                          |
| -------- | ------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `logger` | *[Logger](/sdk/python/references/logger/logger)* | The [Maxim](/sdk/python/references/maxim) logger instance for tracking interactions. |
| `client` | *BaseClient*                                     | The Bedrock client instance to wrap.                                                 |

#### converse\_stream

```python theme={null}
def converse_stream(messages: Iterable[BedrockMessageParam],
                    system: Optional[Union[str, List[Dict[str, str]]]] = None,
                    *,
                    modelId: str,
                    max_tokens: Optional[int] = None,
                    trace_id: Optional[str] = None,
                    generation_name: Optional[str] = None,
                    inferenceConfig: Optional[Dict[str, Any]] = None,
                    toolConfig: Optional[Dict[str, Any]] = None,
                    guardrailConfig: Optional[Dict[str, Any]] = None,
                    performanceConfig: Optional[Dict[str, Any]] = None,
                    additionalModelRequestFields: Optional[Dict[str,
                                                                Any]] = None,
                    **kwargs: Any) -> Iterator[BedrockStreamEvent]
```

Converse with the Bedrock client.

**Arguments**:

| Name                           | Type                                             | Description                                                        |
| ------------------------------ | ------------------------------------------------ | ------------------------------------------------------------------ |
| `messages`                     | *Iterable\[BedrockMessageParam]*                 | The messages to send to the Bedrock client.                        |
| `system`                       | *Optional\[Union\[str, List\[Dict\[str, str]]]]* | The system message to send to the Bedrock client.                  |
| `modelId`                      | *str*                                            | The model ID to use for the Bedrock client.                        |
| `max_tokens`                   | *Optional\[int]*                                 | The maximum number of tokens to generate.                          |
| `trace_id`                     | *Optional\[str]*                                 | The trace ID to use for the Bedrock client.                        |
| `generation_name`              | *Optional\[str]*                                 | The name of the generation to use for the Bedrock client.          |
| `inferenceConfig`              | *Optional\[Dict\[str, Any]]*                     | The inference configuration to use for the Bedrock client.         |
| `toolConfig`                   | *Optional\[Dict\[str, Any]]*                     | The tool configuration to use for the Bedrock client.              |
| `guardrailConfig`              | *Optional\[Dict\[str, Any]]*                     | The guardrail configuration to use for the Bedrock client.         |
| `performanceConfig`            | *Optional\[Dict\[str, Any]]*                     | The performance configuration to use for the Bedrock client.       |
| `additionalModelRequestFields` | *Optional\[Dict\[str, Any]]*                     | The additional model request fields to use for the Bedrock client. |

**Returns**:

| Name                           | Description                                 |
| ------------------------------ | ------------------------------------------- |
| `Iterator[BedrockStreamEvent]` | An iterator over the Bedrock stream events. |

#### converse

```python theme={null}
def converse(messages: Iterable[BedrockMessageParam],
             system: Optional[Union[str, List[Dict[str, str]]]] = None,
             *,
             modelId: str,
             max_tokens: Optional[int] = None,
             trace_id: Optional[str] = None,
             generation_name: Optional[str] = None,
             inferenceConfig: Optional[Dict[str, Any]] = None,
             toolConfig: Optional[Dict[str, Any]] = None,
             guardrailConfig: Optional[Dict[str, Any]] = None,
             performanceConfig: Optional[Dict[str, Any]] = None,
             additionalModelRequestFields: Optional[Dict[str, Any]] = None,
             **kwargs: Any) -> BedrockMessage
```

Converse with the Bedrock client.

**Arguments**:

| Name                           | Type                                             | Description                                                        |
| ------------------------------ | ------------------------------------------------ | ------------------------------------------------------------------ |
| `messages`                     | *Iterable\[BedrockMessageParam]*                 | The messages to send to the Bedrock client.                        |
| `system`                       | *Optional\[Union\[str, List\[Dict\[str, str]]]]* | The system message to send to the Bedrock client.                  |
| `modelId`                      | *str*                                            | The model ID to use for the Bedrock client.                        |
| `max_tokens`                   | *Optional\[int]*                                 | The maximum number of tokens to generate.                          |
| `trace_id`                     | *Optional\[str]*                                 | The trace ID to use for the Bedrock client.                        |
| `generation_name`              | *Optional\[str]*                                 | The name of the generation to use for the Bedrock client.          |
| `inferenceConfig`              | *Optional\[Dict\[str, Any]]*                     | The inference configuration to use for the Bedrock client.         |
| `toolConfig`                   | *Optional\[Dict\[str, Any]]*                     | The tool configuration to use for the Bedrock client.              |
| `guardrailConfig`              | *Optional\[Dict\[str, Any]]*                     | The guardrail configuration to use for the Bedrock client.         |
| `performanceConfig`            | *Optional\[Dict\[str, Any]]*                     | The performance configuration to use for the Bedrock client.       |
| `additionalModelRequestFields` | *Optional\[Dict\[str, Any]]*                     | The additional model request fields to use for the Bedrock client. |

**Returns**:

| Name             | Description                           |
| ---------------- | ------------------------------------- |
| `BedrockMessage` | The response from the Bedrock client. |

#### async\_client

```python theme={null}
@property
def async_client() -> MaximBedrockAsyncClient
```

Get the async client.

**Returns**:

| Name                                                                            | Description       |
| ------------------------------------------------------------------------------- | ----------------- |
| `[MaximBedrockAsyncClient](/sdk/python/references/logger/bedrock/async_client)` | The async client. |
