Skip to content

Commit e6d4459

Browse files
committed
update
1 parent 887275b commit e6d4459

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

articles/ai-foundry/openai/how-to/dall-e.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ The response from a successful image generation API call looks like the followin
153153
You can stream image generation requests to `gpt-image-1` by setting the `stream` parameter to `true`, and setting the `partial_images` parameter to a value between 0 and 3.
154154

155155
```python
156+
import base64
156157
from openai import OpenAI
157158
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
158159

@@ -163,7 +164,7 @@ token_provider = get_bearer_token_provider(
163164
client = OpenAI(
164165
base_url = "https://RESOURCE-NAME-HERE/openai/v1/",
165166
api_key=token_provider,
166-
default_headers={"x-ms-oai-image-generation-deployment":"gpt-image-1", "api_version":"preview"}
167+
default_headers={"api_version":"preview"}
167168
)
168169

169170
stream = client.images.generate(

0 commit comments

Comments
 (0)