File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
articles/ai-foundry/openai/how-to Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1271,18 +1271,17 @@ Use the Responses API if you want to build conversational image experiences with
1271
1271
1272
1272
1273
1273
```python
1274
- from openai import AzureOpenAI
1274
+ from openai import OpenAI
1275
1275
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
1276
1276
1277
1277
token_provider = get_bearer_token_provider(
1278
1278
DefaultAzureCredential(), " https://cognitiveservices.azure.com/.default"
1279
1279
)
1280
1280
1281
- client = AzureOpenAI (
1281
+ client = OpenAI (
1282
1282
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" }
1286
1285
)
1287
1286
1288
1287
response = client.responses.create(
You can’t perform that action at this time.
0 commit comments