The Speech API provides support for real time audio streaming using chunk transfer encoding. This means that the audio is able to be played before the full file has been generated and made accessible.
Based on that, we could have something like an OpenAIAssistant that inherits from AIAssistant and implement a speech method that returns bytes. In addition, we could have a Django endpoint that returns a StreamingHttpResponse.
Description
From OpenAI docs:
Based on that, we could have something like an
OpenAIAssistant
that inherits fromAIAssistant
and implement aspeech
method that returns bytes. In addition, we could have a Django endpoint that returns aStreamingHttpResponse
.Related resources: