RELAYCall

amazon_bedrock

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
Optional[Any]

The prompt configuration for the Bedrock agent.

SWAIG
Optional[dict]

SWAIG configuration for tool/function definitions.

ai_params
Optional[dict]

AI parameters for the Bedrock session.

global_data
Optional[dict]

Data accessible to the AI and SWAIG functions.

post_prompt
Optional[dict]

Post-prompt configuration.

post_prompt_url
Optional[str]

URL to receive the post-prompt result.

Returns

dict — Server response confirming the Bedrock session.

Example

1from signalwire.relay import RelayClient
2
3client = RelayClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7 contexts=["default"],
8)
9
10@client.on_call
11async def handle_call(call):
12 await call.answer()
13
14 # Start an Amazon Bedrock AI agent
15 result = await call.amazon_bedrock(
16 prompt={"text": "You are a helpful assistant."},
17 ai_params={"barge_confidence": 0.02},
18 )
19
20client.run()