Skip to content

Commit 72dc445

Browse files
Merge pull request #6877 from mrbullwinkle/mrb_09_01_2025_chat_completions
[Azure OpenAI] [Chat Completions] [v1] Updates
2 parents 5cf846e + ea09574 commit 72dc445

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

articles/ai-foundry/openai/how-to/chatgpt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ ms.author: mbullwin #delegenz
77
ms.service: azure-ai-openai
88
ms.custom: build-2023, build-2023-dataai, devx-track-python
99
ms.topic: how-to
10-
ms.date: 07/02/2025
10+
ms.date: 09/01/2025
1111
manager: nitinme
1212
keywords: ChatGPT
1313
---
1414

1515
# Work with chat completions models
1616

17-
GPT-3.5-Turbo, GPT-4, and GPT-4o series models are language models that are optimized for conversational interfaces. The models behave differently than the older GPT-3 models. Previous models were text-in and text-out, which means they accepted a prompt string and returned a completion to append to the prompt. However, the latest models are conversation-in and message-out. The models expect input formatted in a specific chat-like transcript format. They return a completion that represents a model-written message in the chat. This format was designed specifically for multi-turn conversations, but it can also work well for nonchat scenarios.
17+
Chat models are language models that are optimized for conversational interfaces. The models behave differently than the older GPT-3 models. Previous models were text-in and text-out, which means they accepted a prompt string and returned a completion to append to the prompt. However, the latest models are conversation-in and message-out. The models expect input formatted in a specific chat-like transcript format. They return a completion that represents a model-written message in the chat. This format was designed specifically for multi-turn conversations, but it can also work well for nonchat scenarios.
1818

1919
This article walks you through getting started with chat completions models. To get the best results, use the techniques described here. Don't try to interact with the models the same way you did with the older model series because the models are often verbose and provide less useful responses.
2020

articles/ai-foundry/openai/includes/chat-completion.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: mrbullwinkle #dereklegenzoff
66
ms.author: mbullwin #delegenz
77
ms.service: azure-ai-openai
88
ms.topic: include
9-
ms.date: 08/29/2024
9+
ms.date: 09/01/2025
1010
manager: nitinme
1111
keywords: ChatGPT
1212

@@ -19,12 +19,11 @@ The following code snippet shows the most basic way to interact with models that
1919

2020
```python
2121
import os
22-
from openai import AzureOpenAI
22+
from openai import OpenAI
2323

24-
client = AzureOpenAI(
24+
client = OpenAI(
2525
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
26-
api_version = "2024-10-21",
27-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
26+
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"
2827
)
2928

3029
response = client.chat.completions.create(
@@ -238,12 +237,11 @@ Every time a new question is asked, a running transcript of the conversation so
238237

239238
```python
240239
import os
241-
from openai import AzureOpenAI
240+
from openai import OpenAI
242241

243-
client = AzureOpenAI(
242+
client = OpenAI(
244243
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
245-
api_version = "2024-10-21",
246-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT") # Your Azure OpenAI resource's endpoint value.
244+
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"
247245
)
248246

249247
conversation=[{"role": "system", "content": "You are a helpful assistant."}]
@@ -279,12 +277,11 @@ The code uses tiktoken `0.5.1`. If you have an older version, run `pip install t
279277
```python
280278
import tiktoken
281279
import os
282-
from openai import AzureOpenAI
280+
from openai import OpenAI
283281

284-
client = AzureOpenAI(
282+
client = OpenAI(
285283
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
286-
api_version = "2024-10-21",
287-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT") # Your Azure OpenAI resource's endpoint value.
284+
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"
288285
)
289286

290287
system_message = {"role": "system", "content": "You are a helpful assistant."}

0 commit comments

Comments
 (0)