You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -41,7 +41,7 @@ Follow these steps to create a new console application.
41
41
```
42
42
1. Run this command to install the OpenAI SDK:
43
43
```console
44
-
pip install openai==0.28.1
44
+
pip install openai
45
45
```
46
46
> [!NOTE]
47
47
> This library is maintained by OpenAI (not Microsoft Azure). Refer to the [release history](https://github.com/openai/openai-python/releases) or the [version.py commit history](https://github.com/openai/openai-python/commits/main/openai/version.py) to track the latest updates to the library.
@@ -51,63 +51,66 @@ Follow these steps to create a new console application.
51
51
```Python
52
52
import os
53
53
import azure.cognitiveservices.speech as speechsdk
54
-
import openai
55
-
56
-
# This example requires environment variables named "OPEN_AI_KEY"and "OPEN_AI_ENDPOINT"
54
+
from openai import AzureOpenAI
55
+
56
+
# This example requires environment variables named "OPEN_AI_KEY", "OPEN_AI_ENDPOINT" and "OPEN_AI_DEPLOYMENT_NAME"
57
57
# Your endpoint should look like the following https://YOUR_OPEN_AI_RESOURCE_NAME.openai.azure.com/
> Make sure that you set the `OPEN_AI_KEY`, `OPEN_AI_ENDPOINT`, `SPEECH_KEY` and `SPEECH_REGION` environment variables as described [previously](#set-environment-variables). If you don't set these variables, the sample will fail with an error message.
149
+
> Make sure that you set the `OPEN_AI_KEY`, `OPEN_AI_ENDPOINT`, `OPEN_AI_DEPLOYMENT_NAME`, `SPEECH_KEY` and `SPEECH_REGION` environment variables as described [previously](#set-environment-variables). If you don't set these variables, the sample will fail with an error message.
147
150
148
151
Speak into your microphone when prompted. The console output includes the prompt for you to begin speaking, then your request as text, and then the response from Azure OpenAI as text. The response from Azure OpenAI should be converted from text to speech and then output to the default speaker.
0 commit comments