You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- An Azure OpenAI resource created in a supported region (see [Region availability](/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability)). For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
26
+
27
+
28
+
#### [JavaScript](#tab/javascript)
29
+
20
30
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services?azure-portal=true)
21
31
-[LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
22
32
- An Azure OpenAI resource created in a supported region (see [Region availability](/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability)). For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
23
33
34
+
---
24
35
25
36
## Setup
26
37
@@ -39,10 +50,10 @@ npm init
39
50
40
51
## Install the client library
41
52
42
-
Install the Azure OpenAI client library for JavaScript with npm:
53
+
Install the client libraries with:
43
54
44
55
```console
45
-
npm install @azure/openai
56
+
npm install openai @azure/identity
46
57
```
47
58
48
59
Your app's _package.json_ file will be updated with the dependencies.
@@ -51,43 +62,123 @@ Your app's _package.json_ file will be updated with the dependencies.
51
62
52
63
Create a new file named _ImageGeneration.js_ and open it in your preferred code editor. Copy the following code into the _ImageGeneration.js_ file:
0 commit comments