Skip to content

Commit 8816b23

Browse files
committed
edits
1 parent 172481f commit 8816b23

File tree

1 file changed

+34
-18
lines changed

1 file changed

+34
-18
lines changed

articles/ai-services/openai/includes/assistants-javascript.md

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,27 @@ In our code we are going to specify the following values:
122122

123123
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).
124124

125-
#### [TypeScript](#tab/typescript)
125+
#### [TypeScript (Recommended) without key](#tab/typescript)
126126

127-
Create an assistant with the following **recommended** passwordless TypeScript module (index.ts):
127+
Create the `index.ts` file with the following **recommended** passwordless TypeScript module (index.ts):
128128

129129
:::code language="typescript" source="~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/ts/src/index.ts" :::
130130

131-
To use the service key for authentication, you can create and run an assistant with the following TypeScript module (index.ts):
131+
Create the `tsconfig.json` file to transpile the TypeScript code and copy the following code for ECMAScript.
132+
133+
```json
134+
{
135+
"compilerOptions": {
136+
"target": "es2022",
137+
"module": "es2022",
138+
"moduleResolution": "node",
139+
}
140+
}
141+
```
142+
143+
#### [TypeScript with key](#tab/typescript)
144+
145+
To use the service key for authentication, you can create the `index.ts` file with the following TypeScript module (index.ts):
132146

133147
:::code language="typescript" source="~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/ts/src/index-using-password.ts" :::
134148

@@ -144,13 +158,15 @@ Create the `tsconfig.json` file to transpile the TypeScript code and copy the fo
144158
}
145159
```
146160

147-
#### [JavaScript](#tab/javascript)
161+
#### [JavaScript without key](#tab/javascript)
148162

149-
Create an assistant with the following **recommended** passwordless JavaScript module (index.mjs):
163+
Create the `index.js` file with the following **recommended** passwordless JavaScript module (index.mjs):
150164

151165
:::code language="javascript" source="~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/js/src/index.mjs" :::
152166

153-
To use the service key for authentication, you can create and run an assistant with the following JavaScript module (index.mjs):
167+
#### [JavaScript with key](#tab/javascript)
168+
169+
To use the service key for authentication, you can create the `index.js` file with the following JavaScript module (index.mjs):
154170

155171
:::code language="javascript" source="~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/js/src/index-using-password.mjs" :::
156172

@@ -164,25 +180,25 @@ To use the service key for authentication, you can create and run an assistant w
164180

165181
#### [TypeScript](#tab/typescript)
166182

167-
Transpile from TypeScript to JavaScript.
183+
Transpile from TypeScript to JavaScript.
168184

169-
```shell
170-
tsc index.ts
171-
```
185+
```shell
186+
tsc index.ts
187+
```
172188

173-
Run the JavaScript file.
189+
Run the JavaScript file.
174190

175-
```shell
176-
node index.js
177-
```
191+
```shell
192+
node index.js
193+
```
178194

179195
#### [JavaScript](#tab/javascript)
180196

181-
Run the JavaScript file.
197+
Run the JavaScript file.
182198

183-
```shell
184-
node index.js
185-
```
199+
```shell
200+
node index.js
201+
```
186202

187203
```
188204

0 commit comments

Comments
 (0)