-
Notifications
You must be signed in to change notification settings - Fork 534
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
Add out-of-band responses + controlled response timing #1320
base: main
Are you sure you want to change the base?
Conversation
|
@@ -287,9 +288,6 @@ def __init__( | |||
ValueError: If the API key is not provided and cannot be found in environment variables. | |||
""" | |||
super().__init__() | |||
self._capabilities = Capabilities( |
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.
We should keep the capabilities
property
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.
Was that a new addition? I just updated with the differences
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.
Yes it is a new one
@@ -880,7 +938,7 @@ def session_update( | |||
input_audio_format: api_proto.AudioFormat | None = None, | |||
output_audio_format: api_proto.AudioFormat | None = None, | |||
input_audio_transcription: InputTranscriptionOptions | None = None, | |||
turn_detection: ServerVadOptions | None = None, | |||
turn_detection: ServerVadOptions | Literal["None"] | None = None, |
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.
I didn't see this PR was also adding None to the turn_detection.
It has been done inside this PR: #1347
We're still interested to have this out-of-band responses tho! :)
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.
I integrated the changes! It should all work now :D
if instructions is not None: | ||
self._sess._queue_msg( | ||
{ | ||
"type": "response.create", | ||
"response": { | ||
"conversation": conversation, | ||
"metadata": metadata, | ||
"instructions": instructions, | ||
"modalities": modalities, | ||
}, | ||
} | ||
) | ||
else: | ||
self._sess._queue_msg( | ||
{ | ||
"type": "response.create", | ||
"response": { | ||
"conversation": conversation, | ||
"metadata": metadata, | ||
"modalities": modalities, | ||
}, | ||
} | ||
) |
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.
Is the reason for this if-else condition the fact that OAI will returns an error if instructions is set to None/null
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.
I forgot but that sounds about right, it works without it now though
I recently came across new additions that OpenAI developed and would love for them to be included in Livekit!
I worked on out-of-band responses and an extra VAD option where responses are not automatic. I also added an option to turn server VAD off by
turn_detection="None"
insession.update()
.Please let me know your thoughts! :-)