Skip to content

Commit 1794e5a

Browse files
committed
update
1 parent e6d4459 commit 1794e5a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,18 +1271,17 @@ Use the Responses API if you want to build conversational image experiences with
12711271

12721272

12731273
```python
1274-
from openai import AzureOpenAI
1274+
from openai import OpenAI
12751275
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
12761276

12771277
token_provider = get_bearer_token_provider(
12781278
DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default"
12791279
)
12801280

1281-
client = AzureOpenAI(
1281+
client = OpenAI(
12821282
base_url = "https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/",
1283-
azure_ad_token_provider=token_provider,
1284-
api_version="preview",
1285-
default_headers={"x-ms-oai-image-generation-deployment":"YOUR-GPT-IMAGE1-DEPLOYMENT-NAME"}
1283+
api_key=token_provider,
1284+
default_headers={"x-ms-oai-image-generation-deployment":"gpt-image-1", "api_version":"preview"}
12861285
)
12871286

12881287
response = client.responses.create(

0 commit comments

Comments
 (0)