|
31 | 31 | "\n", |
32 | 32 | "- Resources will be suffixed by a unique string based on your subscription id.\n", |
33 | 33 | "- Adjust the location parameters according your preferences and on the [product availability by Azure region.](https://azure.microsoft.com/explore/global-infrastructure/products-by-region/?cdn=disable&products=cognitive-services,api-management) \n", |
34 | | - "- Adjust the models and versions according the [availability by region.](https://learn.microsoft.com/azure/ai-services/openai/concepts/models) " |
| 34 | + "- Adjust the models and versions according the [availability by region.](https://learn.microsoft.com/azure/ai-services/openai/concepts/models) \n", |
| 35 | + "\n", |
| 36 | + "*Important* As of the time of this writing, GPT-Image-1 is a gated model, meaning you'll need to [submit a request](https://customervoice.microsoft.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR7en2Ais5pxKtso_Pz4b1_xUQ1VGQUEzRlBIMVU2UFlHSFpSNkpOR0paRSQlQCN0PWcu) to gain access to the model, if you don't have access to GPT-Image-1, you can still use Black Forest models available in most regions" |
35 | 37 | ] |
36 | 38 | }, |
37 | 39 | { |
|
52 | 54 | "\n", |
53 | 55 | "aiservices_config = [{\"name\": \"images\", \"location\": \"westus3\"}]\n", |
54 | 56 | "\n", |
55 | | - "models_config = [{\"name\": \"gpt-image-1\", \"publisher\": \"OpenAI\", \"version\": \"2025-04-15\", \"sku\": \"GlobalStandard\", \"capacity\": 1},\n", |
56 | | - " {\"name\": \"FLUX-1.1-pro\", \"publisher\": \"Black Forest Labs\", \"version\": \"1\", \"sku\": \"GlobalStandard\", \"capacity\": 100},\n", |
57 | | - " {\"name\": \"gpt-4.1\", \"publisher\": \"OpenAI\", \"version\": \"2025-04-14\", \"sku\": \"GlobalStandard\", \"capacity\": 100}]\n", |
| 57 | + "models_config = [{\"name\": \"gpt-4.1\", \"publisher\": \"OpenAI\", \"version\": \"2025-04-14\", \"sku\": \"GlobalStandard\", \"capacity\": 100}, ## a multi-modal chat completion model to analyze images and text\n", |
| 58 | + " {\"name\": \"gpt-image-1\", \"publisher\": \"OpenAI\", \"version\": \"2025-04-15\", \"sku\": \"GlobalStandard\", \"capacity\": 1},\n", |
| 59 | + " {\"name\": \"FLUX-1.1-pro\", \"publisher\": \"Black Forest Labs\", \"version\": \"1\", \"sku\": \"GlobalStandard\", \"capacity\": 100}]\n", |
58 | 60 | "\n", |
59 | 61 | "apim_sku = 'Basicv2'\n", |
60 | 62 | "apim_subscriptions_config = [{\"name\": \"subscription1\", \"displayName\": \"Subscription 1\"}]\n", |
|
284 | 286 | "metadata": {}, |
285 | 287 | "outputs": [], |
286 | 288 | "source": [ |
287 | | - "url = f\"{apim_resource_gateway_url}/{inference_api_path}/openai/deployments/{models_config[2]['name']}/chat/completions?api-version={inference_api_version}\"\n", |
| 289 | + "url = f\"{apim_resource_gateway_url}/{inference_api_path}/openai/deployments/{models_config[0]['name']}/chat/completions?api-version={inference_api_version}\"\n", |
288 | 290 | "\n", |
289 | 291 | "messages = { \"messages\": [\n", |
290 | 292 | " {\"role\": \"system\", \"content\": \"You are a sarcastic unhelpful assistant.\"},\n", |
|
384 | 386 | ")\n", |
385 | 387 | "\n", |
386 | 388 | "response = client.chat.completions.create(\n", |
387 | | - " model = models_config[2]['name'], \n", |
| 389 | + " model = models_config[0]['name'], \n", |
388 | 390 | " messages = [\n", |
389 | 391 | " {\"role\": \"system\", \"content\": \"You are a sarcastic helpful assistant.\"},\n", |
390 | 392 | " {\"role\": \"user\", \"content\": [\n", |
|
0 commit comments