openai icon indicating copy to clipboard operation
openai copied to clipboard

Can't use createSpeech without saving to file.

Open allComputableThings opened this issue 11 months ago • 3 comments

OpenAI.instance.audio.createSpeech insists on saving the result to a file. It doesn't seem necessary (and is problematic for me). (Perhaps it could return the result if the file and directory were null?)

Looking at its implementation, I also can't directly call await OpenAINetworkingClient.post ... since it is not exported.

allComputableThings avatar Apr 03 '24 18:04 allComputableThings

Yeah, this makes sense, but what would be the expected behavior here?

anasfik avatar May 08 '24 18:05 anasfik

I'd like to invoke it using a BytesSource: https://pub.dev/documentation/audioplayers/latest/audioplayers/BytesSource-class.html

would that be possible?

dylandhall avatar May 29 '24 08:05 dylandhall

I have opened a PR that hopefully adds this: https://github.com/anasfik/openai/pull/177

I'm new to Dart so please check it over, it should work however.

Edit: works, example code in PR

dylandhall avatar May 29 '24 09:05 dylandhall