RelayCall

ai_unhold

View as MarkdownOpen in Claude

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

Parameters

prompt
str | NoneDefaults to None

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

import asyncio
from signalwire.relay import RelayClient
client = RelayClient(
project="your-project-id",
token="your-api-token",
contexts=["default"],
)
@client.on_call
async def handle_call(call):
await call.answer()
# Start an AI agent
action = await call.ai(
prompt={"text": "You are a support agent."},
)
# Put the AI on hold
await call.ai_hold(prompt="One moment please.")
# Do some processing...
await asyncio.sleep(5)
# Resume the AI
await call.ai_unhold(prompt="Thanks for waiting. I found your information.")
client.run()