Skip to content

Commit 508355d

Browse files
committed
Azure OpenAI terminology
1 parent b204db6 commit 508355d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

articles/ai-services/speech-service/includes/quickstarts/openai-speech/python.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This example requires environment variables named `AZURE_OPENAI_API_KEY`, `AZURE
3535

3636
Follow these steps to create a new console application.
3737

38-
1. Open a command prompt window in the folder where you want the new project. Open a command prompt where you want the new project, and create a new file named `openai-speech.py`.
38+
1. Open a command prompt window in the folder where you want the new project. Open a command prompt where you want the new project, and create a new file named `azure-openai-speech.py`.
3939

4040
1. Run this command to install the Speech SDK:
4141

@@ -52,7 +52,7 @@ Follow these steps to create a new console application.
5252
> [!NOTE]
5353
> 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.
5454

55-
1. Create a file named *openai-speech.py*. Copy the following code into that file:
55+
1. Create a file named *azure-openai-speech.py*. Copy the following code into that file:
5656

5757
```Python
5858
import os
@@ -86,7 +86,7 @@ Follow these steps to create a new console application.
8686
tts_sentence_end = [ ".", "!", "?", ";", "。", "!", "?", ";", "\n" ]
8787

8888
# Prompts Azure OpenAI with a request and synthesizes the response.
89-
def ask_openai(prompt):
89+
def ask_azure_openai(prompt):
9090
# Ask Azure OpenAI in streaming way
9191
response = client.chat.completions.create(model=deployment_id, max_tokens=200, stream=True, messages=[
9292
{"role": "user", "content": prompt}
@@ -110,7 +110,7 @@ Follow these steps to create a new console application.
110110
last_tts_request.get()
111111

112112
# Continuously listens for speech input to recognize and send as text to Azure OpenAI
113-
def chat_with_open_ai():
113+
def chat_with_azure_openai():
114114
while True:
115115
print("Azure OpenAI is listening. Say 'Stop' or press Ctrl-Z to end the conversation.")
116116
try:
@@ -123,7 +123,7 @@ Follow these steps to create a new console application.
123123
print("Conversation ended.")
124124
break
125125
print("Recognized speech: {}".format(speech_recognition_result.text))
126-
ask_openai(speech_recognition_result.text)
126+
ask_azure_openai(speech_recognition_result.text)
127127
elif speech_recognition_result.reason == speechsdk.ResultReason.NoMatch:
128128
print("No speech could be recognized: {}".format(speech_recognition_result.no_match_details))
129129
break
@@ -138,7 +138,7 @@ Follow these steps to create a new console application.
138138
# Main
139139

140140
try:
141-
chat_with_open_ai()
141+
chat_with_azure_openai()
142142
except Exception as err:
143143
print("Encountered exception. {}".format(err))
144144
```
@@ -148,7 +148,7 @@ Follow these steps to create a new console application.
148148
1. Run your new console application to start speech recognition from a microphone:
149149

150150
```console
151-
python openai-speech.py
151+
python azure-openai-speech.py
152152
```
153153

154154
> [!IMPORTANT]
@@ -157,7 +157,7 @@ Follow these steps to create a new console application.
157157
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.
158158

159159
```console
160-
PS C:\dev\openai\python> python.exe .\openai-speech.py
160+
PS C:\dev\openai\python> python.exe .\azure-openai-speech.py
161161
Azure OpenAI is listening. Say 'Stop' or press Ctrl-Z to end the conversation.
162162
Recognized speech:Make a comma separated list of all continents.
163163
Azure OpenAI response:Africa, Antarctica, Asia, Australia, Europe, North America, South America

articles/ai-services/speech-service/openai-speech.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.date: 02/08/2024
1111
ms.author: eur
1212
zone_pivot_groups: programming-languages-csharp-python
1313
keywords: speech to text, openai
14-
#customer intent: As a developer, I want to create a voice-based chat system to talk to the OpenAI application I host through Azure to simplify AI interactions.
14+
#customer intent: As a developer, I want to create a voice-based chat system to talk to the Azure OpenAI application I host through Azure to simplify AI interactions.
1515
---
1616

1717
# Azure OpenAI speech to speech chat

0 commit comments

Comments
 (0)