***

title: amazonBedrock
slug: /reference/typescript/relay/call/amazon-bedrock
description: Connect a call to an Amazon Bedrock AI agent.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ai]: /docs/server-sdks/reference/typescript/relay/call/ai

Connect the call to an Amazon Bedrock AI agent. Similar to
[`ai()`][ai] but uses Amazon Bedrock as
the LLM backend.

## **Parameters**

<ParamField path="prompt" type="unknown | undefined" toc={true}>
  The prompt configuration for the Bedrock agent.
</ParamField>

<ParamField path="SWAIG" type="Record<string, unknown> | undefined" toc={true}>
  SWAIG configuration for tool/function definitions.
</ParamField>

<ParamField path="aiParams" type="Record<string, unknown> | undefined" toc={true}>
  AI parameters for the Bedrock session.
</ParamField>

<ParamField path="globalData" type="Record<string, unknown> | undefined" toc={true}>
  Data accessible to the AI and SWAIG functions.
</ParamField>

<ParamField path="postPrompt" type="Record<string, unknown> | undefined" toc={true}>
  Post-prompt configuration.
</ParamField>

<ParamField path="postPromptUrl" type="string | undefined" toc={true}>
  URL to receive the post-prompt result.
</ParamField>

## **Returns**

`Promise<Record<string, unknown>>` -- Server response confirming the Bedrock session.

## **Example**

```typescript {13}
import { RelayClient } from '@signalwire/sdk';

const client = new RelayClient({
  project: process.env.SIGNALWIRE_PROJECT_ID!,
  token: process.env.SIGNALWIRE_TOKEN!,
  contexts: ['default']
});

client.onCall(async (call) => {
  await call.answer();

  // Start an Amazon Bedrock AI agent
  const result = await call.amazonBedrock({
    prompt: { text: 'You are a helpful assistant.' },
    aiParams: { barge_confidence: 0.02 },
  });
});

await client.run();
```