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
|`ENDPOINT`| This value can be found in the **Keys and Endpoint** section when examining your resource from the Azure portal. Alternatively, you can find the value in **Azure OpenAI Studio** > **Playground** > **View code**. An example endpoint is: `https://docs-test-001.openai.azure.com/`.|
13
+
|`API-KEY`| This value can be found in the **Keys and Endpoint** section when examining your resource from the Azure portal. You can use either `KEY1` or `KEY2`.|
14
+
|`DEPLOYMENT-NAME`| This value will correspond to the custom name you chose for your deployment when you deployed a model. This value can be found under **Resource Management** > **Model Deployments** in the Azure portal or alternatively under **Management** > **Deployments** in Azure OpenAI Studio.|
15
+
16
+
Go to your resource in the Azure portal. The **Keys and Endpoint** can be found in the **Resource Management** section. Copy your endpoint and access key as you'll need both for authenticating your API calls. You can use either `KEY1` or `KEY2`. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.
17
+
18
+
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview blade for an OpenAI Resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
| `RESOURCE_NAME` | This value can be found in the Azure portal for the Azure OpenAI resource.
13
+
|`ENDPOINT`| This value can be found in the **Keys and Endpoint** section when examining your resource from the Azure portal. Alternatively, you can find the value in **Azure OpenAI Studio** > **Playground** > **View code**. An example endpoint is: `https://docs-test-001.openai.azure.com/`.|
14
+
|`DEPLOYMENT-NAME`| This value will correspond to the custom name you chose for your deployment when you deployed a model. This value can be found under **Resource Management** > **Model Deployments** in the Azure portal or alternatively under **Management** > **Deployments** in Azure OpenAI Studio.|
Copy file name to clipboardExpand all lines: articles/ai-services/openai/includes/assistants-javascript.md
+15-45Lines changed: 15 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,44 +68,26 @@ For passwordless authentication, you need to
68
68
69
69
To successfully make a call against the Azure OpenAI service, you'll need the following:
70
70
71
-
|Variable name | Value |
72
-
|--------------------------|-------------|
73
-
| `ENDPOINT` | This value can be found in the **Keys and Endpoint** section when examining your resource from the Azure portal. Alternatively, you can find the value in **Azure OpenAI Studio** > **Playground** > **View code**. An example endpoint is: `https://docs-test-001.openai.azure.com/`.|
74
-
| `API-KEY` | This value can be found in the **Keys and Endpoint** section when examining your resource from the Azure portal. You can use either `KEY1` or `KEY2`.|
75
-
| `DEPLOYMENT-NAME` | This value will correspond to the custom name you chose for your deployment when you deployed a model. This value can be found under **Resource Management** > **Model Deployments** in the Azure portal or alternatively under **Management** > **Deployments** in Azure OpenAI Studio.|
71
+
#### [TypeScript without key (Recommended)](#tab/typescript)
76
72
77
-
Go to your resource in the Azure portal. The **Keys and Endpoint** can be found in the **Resource Management** section. Copy your endpoint and access key as you'll need both for authenticating your API calls. You can use either `KEY1` or `KEY2`. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview blade for an OpenAI Resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
@@ -122,7 +104,7 @@ In our code we are going to specify the following values:
122
104
123
105
An individual assistant can access up to 128 tools including `code interpreter`, as well as any custom tools you create via [functions](../how-to/assistant-functions.md).
124
106
125
-
#### [TypeScript (Recommended) without key](#tab/typescript)
107
+
#### [TypeScript without key (Recommended)](#tab/typescript)
126
108
127
109
1. Create the `index.ts` file with the following **recommended** passwordless TypeScript module (index.ts):
128
110
@@ -364,12 +346,6 @@ An individual assistant can access up to 128 tools including `code interpreter`,
364
346
```shell
365
347
tsc index.ts
366
348
```
367
-
368
-
1. Sign in to Azure with the following command:
369
-
370
-
```shell
371
-
az login
372
-
```
373
349
374
350
1. Run the code with the following command:
375
351
@@ -379,7 +355,7 @@ An individual assistant can access up to 128 tools including `code interpreter`,
379
355
380
356
#### [JavaScript without key](#tab/javascript)
381
357
382
-
1. Create the `index.js` file with the following **recommended** passwordless JavaScript module (index.mjs):
358
+
1. Create the `index.js` file with the following **recommended** passwordless JavaScript module:
383
359
384
360
```nodejs
385
361
import { AzureOpenAI } from "openai";
@@ -485,7 +461,7 @@ An individual assistant can access up to 128 tools including `code interpreter`,
485
461
486
462
#### [JavaScript with key](#tab/javascript-key)
487
463
488
-
1. To use the service key for authentication, you can create the `index.js` file with the following JavaScript module (index.mjs):
464
+
1. To use the service key for authentication, you can create the `index.js` file with the following JavaScript module:
489
465
490
466
```nodejs
491
467
import { AzureOpenAI } from "openai";
@@ -569,12 +545,6 @@ An individual assistant can access up to 128 tools including `code interpreter`,
0 commit comments