> For the complete documentation index, see [llms.txt](https://docs.wisej.com/ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/ai/components/api/smartendpoint/wisej.ai.endpoints.amazonbedrockendpoint.md).

# AmazonBedrockEndpoint

Namespace: **Wisej.AI.Endpoints**

Assembly: **Wisej.AI** (3.5.0.0)

* [SmartEndpoint](/ai/components/api/smartendpoint.md)
  * [SmartHttpEndpoint](/ai/components/api/smartendpoint/wisej.ai.endpoints.smarthttpendpoint.md)
    * [AmazonBedrockEndpoint](/ai/components/api/smartendpoint/wisej.ai.endpoints.amazonbedrockendpoint.md)

Represents an endpoint for connecting to Amazon Bedrock services.

{% tabs %}
{% tab title="C#" %}

```csharp
public class AmazonBedrockEndpoint : SmartHttpEndpoint
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class AmazonBedrockEndpoint
    Inherits SmartHttpEndpoint
```

{% endtab %}
{% endtabs %}

This class is used to configure and manage connections to Amazon Bedrock endpoints, specifically for interacting with the Anthropic API.

## Constructors

### ![](/files/ptrKjmmRoQB76pvrIqh0) AmazonBedrockEndpoint()

Initializes a new instance of the [AmazonBedrockEndpoint](/ai/components/api/smartendpoint/wisej.ai.endpoints.amazonbedrockendpoint.md) class.

Sets default values for authentication, model, URL, and headers.

## Properties

### ![](/files/ptrKjmmRoQB76pvrIqh0) Authentication

[String](https://docs.microsoft.com/dotnet/api/system.string): Gets or sets the authentication method for the endpoint. (Default: `"x-api-key"`)

### ![](/files/ptrKjmmRoQB76pvrIqh0) Model

[String](https://docs.microsoft.com/dotnet/api/system.string): Gets or sets the model used for the endpoint. (Default: `"claude-3-opus-20240229"`)

### ![](/files/ptrKjmmRoQB76pvrIqh0) URL

[String](https://docs.microsoft.com/dotnet/api/system.string): Gets or sets the URL for the endpoint. (Default: `"https://api.anthropic.com/v1/messages"`)

## Methods

### ![](/files/KL0Ik37djZRr8a07Wopd) AddMessages(payload, session, messages)

Adds messages to the payload.

| Parameter    | Type                                                                                        | Description                              |
| ------------ | ------------------------------------------------------------------------------------------- | ---------------------------------------- |
| **payload**  | [Object](https://docs.microsoft.com/dotnet/api/system.object)                               | The payload to which messages are added. |
| **session**  | [SmartSession](/ai/components/api/smartsession.md)                                          | The current session context.             |
| **messages** | [IList\<Message>](https://docs.microsoft.com/dotnet/api/system.collections.generic.ilist-1) | The list of messages to add.             |

Ensures the system message is complete and prepares the payload for sending.

### ![](/files/KL0Ik37djZRr8a07Wopd) AddOptions(message, session)

Adds options to the message payload.

| Parameter   | Type                                                          | Description                    |
| ----------- | ------------------------------------------------------------- | ------------------------------ |
| **message** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | The message payload to modify. |
| **session** | [SmartSession](/ai/components/api/smartsession.md)            | The current session context.   |

Sets default values for temperature and max tokens in the message payload.

### ![](/files/KL0Ik37djZRr8a07Wopd) BuildMessage(message)

Builds a message object from a [Message](/ai/components/api/smartsession/wisej.ai.smartsession.message.md) instance.

| Parameter   | Type                                                                        | Description             |
| ----------- | --------------------------------------------------------------------------- | ----------------------- |
| **message** | [Message](/ai/components/api/smartsession/wisej.ai.smartsession.message.md) | The message to convert. |

**Returns:** [Object](https://docs.microsoft.com/dotnet/api/system.object). A dynamic object representing the message.

Handles different input types, including text and images.

### ![](/files/KL0Ik37djZRr8a07Wopd) ReadAssistantMessage(response, message)

Reads the assistant's message from the response.

| Parameter    | Type                                                                            | Description                                      |
| ------------ | ------------------------------------------------------------------------------- | ------------------------------------------------ |
| **response** | [Response](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.response.md) | The response containing the assistant's message. |
| **message**  | [Message](/ai/components/api/smartsession/wisej.ai.smartsession.message.md)     | The message object to populate.                  |

Parses the response stream to extract the assistant's message content.

### ![](/files/KL0Ik37djZRr8a07Wopd) ReadUsage(message, reply)

Reads the usage information from the reply.

| Parameter   | Type                                                                        | Description                                            |
| ----------- | --------------------------------------------------------------------------- | ------------------------------------------------------ |
| **message** | [Message](/ai/components/api/smartsession/wisej.ai.smartsession.message.md) | The message object to update with usage data.          |
| **reply**   | [Object](https://docs.microsoft.com/dotnet/api/system.object)               | The dynamic reply object containing usage information. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/ai/components/api/smartendpoint/wisej.ai.endpoints.amazonbedrockendpoint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
