aiUnhold

View as MarkdownOpen in Claude

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

Parameters

prompt
string | undefined

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

Returns

Promise<Record<string, unknown>> — Server response confirming the AI unhold.

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 AI agent
const action = await call.ai({
prompt: { text: 'You are a support agent.' },
});
// Put the AI on hold
await call.aiHold({ prompt: 'One moment please.' });
// Do some processing...
await new Promise((resolve) => setTimeout(resolve, 5000));
// Resume the AI
await call.aiUnhold({ prompt: 'Thanks for waiting. I found your information.' });
});
await client.run();