Skip to navigation

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

import { RelayClient } from '@signalwire/sdk';
const client = new RelayClient({
project: process.env.SIGNALWIRE_PROJECT_ID!,
token: process.env.SIGNALWIRE_API_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();