commit
93d752e1f0
|
|
@ -44,8 +44,8 @@ public class HangupPhoneCallFn : IFunctionCallback
|
|||
var processUrl = $"{_twilioSetting.CallbackHost}/twilio/voice/hang-up?agent-id={message.CurrentAgentId}&conversation-id={conversationId}";
|
||||
|
||||
// Generate initial assistant audio
|
||||
/*string initAudioFile = null;
|
||||
if (!string.IsNullOrEmpty(args.ResponseContent))
|
||||
string initAudioFile = null;
|
||||
if (!string.IsNullOrEmpty(args.ResponseContent) && _twilioSetting.GenerateEndingAudio)
|
||||
{
|
||||
var completion = CompletionProvider.GetAudioSynthesizer(_services);
|
||||
var data = await completion.GenerateAudioAsync(args.ResponseContent);
|
||||
|
|
@ -53,7 +53,7 @@ public class HangupPhoneCallFn : IFunctionCallback
|
|||
fileStorage.SaveSpeechFile(conversationId, initAudioFile, data);
|
||||
|
||||
processUrl += $"&init-audio-file={initAudioFile}";
|
||||
}*/
|
||||
}
|
||||
|
||||
var call = CallResource.Update(
|
||||
url: new Uri(processUrl),
|
||||
|
|
|
|||
|
|
@ -145,10 +145,6 @@ public class TwilioService
|
|||
response.Play(new Uri(uri));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
response.Say("Goodbye.");
|
||||
}
|
||||
|
||||
response.Hangup();
|
||||
return response;
|
||||
|
|
|
|||
|
|
@ -32,4 +32,5 @@ public class TwilioSetting
|
|||
public bool TranscribeEnabled { get; set; } = false;
|
||||
|
||||
public bool GenerateReplyAudio { get; set; } = true;
|
||||
public bool GenerateEndingAudio { get; set; } = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,12 @@
|
|||
"reason": {
|
||||
"type": "string",
|
||||
"description": "The reason why user wants to end the phone call."
|
||||
},
|
||||
"response_content": {
|
||||
"type": "string",
|
||||
"description": "A response statement said to the user to politely and gratefully ending a conversation before hanging up."
|
||||
}
|
||||
},
|
||||
"required": [ "reason" ]
|
||||
"required": [ "reason", "response_content" ]
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue