amazonBedrock

View as MarkdownOpen in Claude

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

Parameters

prompt
unknown | undefined

The prompt configuration for the Bedrock agent.

SWAIG
Record<string, unknown> | undefined

SWAIG configuration for tool/function definitions.

aiParams
Record<string, unknown> | undefined

AI parameters for the Bedrock session.

globalData
Record<string, unknown> | undefined

Data accessible to the AI and SWAIG functions.

postPrompt
Record<string, unknown> | undefined

Post-prompt configuration.

postPromptUrl
string | undefined

URL to receive the post-prompt result.

Returns

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

Example

1import { RelayClient } from '@signalwire/sdk';
2
3const client = new RelayClient({
4 project: process.env.SIGNALWIRE_PROJECT_ID!,
5 token: process.env.SIGNALWIRE_TOKEN!,
6 contexts: ['default']
7});
8
9client.onCall(async (call) => {
10 await call.answer();
11
12 // Start an Amazon Bedrock AI agent
13 const result = await call.amazonBedrock({
14 prompt: { text: 'You are a helpful assistant.' },
15 aiParams: { barge_confidence: 0.02 },
16 });
17});
18
19await client.run();