-
Notifications
You must be signed in to change notification settings - Fork 121
Close OpenAI websocket on Twilio call end #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@rafalszulejko But how can I notify that the call is about to end? Or to hung up |
When you hang up, a |
Thank you @rafalszulejko |
Do you know how to make similar outbound call @rafalszulejko ? |
Thank you! @rafalszulejko |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But to hung up the call we need to send the stop event from the conversation as well right?
If you hang up on your phone, stop event will be sent and application can handle it. If you want to end call on the application side, just close the twilio websocket and the call will end automatically. |
Yes, I am asking in terms of application prospective To hung the call from AI side we have to have some end token like |
The other pull request in this repo seems to do that but I think it would
be better to use function/tool calls there.
czw., 6 mar 2025, 12:10 użytkownik Mahimai Raja ***@***.***>
napisał:
… Yes, I am asking in terms of application prospective
To hung the call from AI side we have to have some end token like
[end_call] and then after receiving it we need to close the websocket?
—
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNWXGBHC6P3KCB4UO7EKW32TCFSFAVCNFSM6AAAAABXL2DKYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBUGU4TCOJUGE>
.
You are receiving this because you were mentioned.Message ID:
<twilio-samples/speech-assistant-openai-realtime-api-python/pull/36/c2704591941
@github.com>
[image: mahimairaja]*mahimairaja* left a comment
(twilio-samples/speech-assistant-openai-realtime-api-python#36)
<#36 (comment)>
Yes, I am asking in terms of application prospective
To hung the call from AI side we have to have some end token like
[end_call] and then after receiving it we need to close the websocket?
—
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNWXGBHC6P3KCB4UO7EKW32TCFSFAVCNFSM6AAAAABXL2DKYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBUGU4TCOJUGE>
.
You are receiving this because you were mentioned.Message ID:
<twilio-samples/speech-assistant-openai-realtime-api-python/pull/36/c2704591941
@github.com>
|
What are you mentioning as function calling here? Anything related to langchain or LLM tool calling? |
https://platform.openai.com/docs/guides/realtime-model-capabilities#function-calling
czw., 6 mar 2025, 12:22 użytkownik Mahimai Raja ***@***.***>
napisał:
… What are you mentioning as function calling here? Anything related to
langchain or LLM tool calling?
—
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNWXGBYCYHTO3LFPX5HOJD2TCG7JAVCNFSM6AAAAABXL2DKYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBUGYYTSNBRGA>
.
You are receiving this because you were mentioned.Message ID:
<twilio-samples/speech-assistant-openai-realtime-api-python/pull/36/c2704619410
@github.com>
[image: mahimairaja]*mahimairaja* left a comment
(twilio-samples/speech-assistant-openai-realtime-api-python#36)
<#36 (comment)>
What are you mentioning as function calling here? Anything related to
langchain or LLM tool calling?
—
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNWXGBYCYHTO3LFPX5HOJD2TCG7JAVCNFSM6AAAAABXL2DKYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBUGYYTSNBRGA>
.
You are receiving this because you were mentioned.Message ID:
<twilio-samples/speech-assistant-openai-realtime-api-python/pull/36/c2704619410
@github.com>
|
On Twilio call end, the OpenAI websocket connection isn't closed, leading to an error happening in 30 minutes (maximum permissible OpenAI real-time session length). This also prevents graceful app exit on Ctrl+C.
The proposed change closes the connection on "stop" event from Twilio, received at a call end.