RELAYCall

ai_unhold

View as MarkdownOpen in Claude

Resume an AI agent session from hold. The AI resumes processing the conversation.

Parameters

prompt
Optional[str]

A prompt for the AI to speak upon resuming (e.g., “Thank you for holding. I have your information now.”).

Returns

dict — Server response confirming the AI unhold.

Example

1import asyncio
2from signalwire.relay import RelayClient
3
4client = RelayClient(
5 project="your-project-id",
6 token="your-api-token",
7 host="your-space.signalwire.com",
8 contexts=["default"],
9)
10
11@client.on_call
12async def handle_call(call):
13 await call.answer()
14
15 # Start an AI agent
16 action = await call.ai(
17 prompt={"text": "You are a support agent."},
18 )
19
20 # Put the AI on hold
21 await call.ai_hold(prompt="One moment please.")
22
23 # Do some processing...
24 await asyncio.sleep(5)
25
26 # Resume the AI
27 await call.ai_unhold(prompt="Thanks for waiting. I found your information.")
28
29client.run()