django-ai-assistant
django-ai-assistant copied to clipboard
Consider implementing OpenAI speech-to-text
Description
From OpenAI docs:
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.
Related resources:
- https://platform.openai.com/docs/guides/text-to-speech
- https://github.com/langchain-ai/langchain/pull/18427