From b0a6072047e98cb1396a5cfdc84dd6676dad49f9 Mon Sep 17 00:00:00 2001 From: matatonic Date: Wed, 20 Mar 2024 18:25:25 -0400 Subject: [PATCH] update openai example --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4a9c181..f74dbef 100644 --- a/README.md +++ b/README.md @@ -110,13 +110,12 @@ client = openai.OpenAI( base_url = "http://localhost:8000/v1", ) -response = client.audio.speech.create( +with client.audio.speech.with_streaming_response.create( model="tts-1", voice="alloy", input="Today is a wonderful day to build something people love!" -) - -response.stream_to_file("speech.mp3") +) as response: + response.stream_to_file("speech.mp3") ``` Docker support