betalgo / openai

OpenAI .NET sdk - Azure OpenAI, ChatGPT, Whisper, and DALL-E
https://betalgo.github.io/openai/
MIT License
2.85k stars 513 forks source link

Create Speech example #438

Closed hierro1981 closed 7 months ago

hierro1981 commented 7 months ago

Would you please share an example for using the CreateSpeech service? The firm is:

public async Task<AudioCreateSpeechResponse<T>> CreateSpeech<T>(AudioCreateSpeechRequest audioCreateSpeechRequest, CancellationToken cancellationToken = default)

but I don't know what type to use for T. Trying object or string I get a Unsupported type for TData error.

hierro1981 commented 7 months ago

I just found it under https://github.com/betalgo/openai/blob/master/OpenAI.Playground/TestHelpers/AudioTestHelper.cs , maybe it will be helpful to add it in the wiki.