Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/tools/voice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,20 @@ export const voiceCallCapability: CapabilityHandler = {
type: 'boolean',
description: 'If true, AI waits for the recipient to speak first before talking.',
},
voicemail_action: {
type: 'string',
enum: ['hangup', 'leave_message', 'ignore'],
description:
'What to do if voicemail is detected. Default (omitted): hang up without a message. ' +
'"leave_message" speaks voicemail_message once then hangs up (voicemail_message required). ' +
'"ignore" skips detection and treats the call as live — only use when sure a human answers.',
},
voicemail_message: {
type: 'string',
description:
'The message to leave when voicemail_action is "leave_message" (≤1000 chars). ' +
'Voicemail is one-way — this is spoken once as a monologue, there is no back-and-forth.',
},
},
required: ['to', 'from', 'task'],
},
Expand All @@ -306,6 +320,8 @@ export const voiceCallCapability: CapabilityHandler = {
if (typeof input.language === 'string') body.language = input.language;
if (typeof input.first_sentence === 'string') body.first_sentence = input.first_sentence;
if (typeof input.wait_for_greeting === 'boolean') body.wait_for_greeting = input.wait_for_greeting;
if (typeof input.voicemail_action === 'string') body.voicemail_action = input.voicemail_action;
if (typeof input.voicemail_message === 'string') body.voicemail_message = input.voicemail_message;

try {
const res = await postWithPayment<Record<string, unknown>>(
Expand Down
Loading