SignalWire
view release on metacpan or search on metacpan
examples/session_and_state_demo.pl view on Meta::CPAN
description => 'Update customer communication preferences',
parameters => {
type => 'object',
properties => {
email_notifications => { type => 'boolean', description => 'Enable email notifications' },
sms_notifications => { type => 'boolean', description => 'Enable SMS notifications' },
},
},
handler => sub {
my ($args, $raw) = @_;
my @prefs;
push @prefs, 'email' if $args->{email_notifications};
push @prefs, 'SMS' if $args->{sms_notifications};
my $pref_str = @prefs ? join(' and ', @prefs) : 'none';
return SignalWire::SWAIG::FunctionResult->new(
"Preferences updated: $pref_str notifications enabled."
);
},
);
# --- Tool: end_call ---
$agent->define_tool(
name => 'end_call',
description => 'End the call after saying goodbye',
( run in 0.821 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )