openai-java
openai-java copied to clipboard
createTranscription needs a stream api
Now, createTranscription has filePath and Audio parameter to upload audio file. but if I am the server, I just want to forward the client audio stream to chatgpt, I need to save the Multipart input stream to a disk file and then pass it to the sdk, then the sdk read it from the disk, which needs more IO operations. In order to avoid the IO operations, I need another api for createTranscription, thanks.
before I can suggest a solution to this - you are getting the stream in which format? like how are you getting the audio in a stream? @xmkevin
Ideally how you can do it, do the entire process in batches, since there's no stream API by OpenAI, i m sure you can divide your stream into 30 second clip - save it (in memory not disk) - transcribe it (then save to db)- and destroy the file, Yes, it is tacky but certainly doable.