@@ -124,81 +124,99 @@ An individual assistant can access up to 128 tools including `code interpreter`,
124
124
125
125
# ### [TypeScript (Recommended) without key](#tab/typescript)
126
126
127
- Create the ` index.ts` file with the following ** recommended** passwordless TypeScript module (index.ts):
127
+ 1. Create the ` index.ts` file with the following ** recommended** passwordless TypeScript module (index.ts):
128
128
129
- :::code language=" typescript" source=" ~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/ts/src/index.ts" :::
129
+ :::code language=" typescript" source=" ~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/ts/src/index.ts" :::
130
130
131
- Create the ` tsconfig.json` file to transpile the TypeScript code and copy the following code for ECMAScript.
131
+ 1. Create the ` tsconfig.json` file to transpile the TypeScript code and copy the following code for ECMAScript.
132
132
133
- ` ` ` json
134
- {
135
- " compilerOptions" : {
136
- " target" : " es2022" ,
137
- " module" : " es2022" ,
138
- " moduleResolution" : " node" ,
139
- }
140
- }
141
- ` ` `
133
+ ` ` ` json
134
+ {
135
+ " compilerOptions" : {
136
+ " target" : " es2022" ,
137
+ " module" : " es2022" ,
138
+ " moduleResolution" : " node" ,
139
+ }
140
+ }
141
+ ` ` `
142
142
143
- # ### [ TypeScript with key](#tab/typescript)
143
+ 1. Transpile from TypeScript to JavaScript.
144
144
145
- To use the service key for authentication, you can create the ` index.ts` file with the following TypeScript module (index.ts):
145
+ ` ` ` shell
146
+ tsc index.ts
147
+ ` ` `
148
+
149
+ 1. Sign in to Azure with the following command:
146
150
147
- :::code language=" typescript" source=" ~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/ts/src/index-using-password.ts" :::
151
+ ` ` ` shell
152
+ az login
153
+ ` ` `
148
154
149
- Create the ` tsconfig.json ` file to transpile the TypeScript code and copy the following code for ECMAScript.
155
+ 1. Run the code with the following command:
150
156
151
- ` ` ` json
152
- {
153
- " compilerOptions" : {
154
- " target" : " es2022" ,
155
- " module" : " es2022" ,
156
- " moduleResolution" : " node" ,
157
- }
158
- }
159
- ` ` `
157
+ ` ` ` shell
158
+ node index.js
159
+ ` ` `
160
160
161
- # ### [JavaScript without key](#tab/javascript )
161
+ # ### [TypeScript with key](#tab/typescript-key )
162
162
163
- Create the ` index.js ` file with the following ** recommended ** passwordless JavaScript module (index.mjs ):
163
+ 1. To use the service key for authentication, you can create the ` index.ts ` file with the following TypeScript module (index.ts ):
164
164
165
- :::code language=" javascript " source=" ~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/js /src/index.mjs " :::
165
+ :::code language=" typescript " source=" ~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/ts /src/index-using-password.ts " :::
166
166
167
- # ### [JavaScript with key](#tab/javascript)
167
+ 1. Create the ` tsconfig.json ` file to transpile the TypeScript code and copy the following code for ECMAScript.
168
168
169
- To use the service key for authentication, you can create the ` index.js` file with the following JavaScript module (index.mjs):
169
+ ` ` ` json
170
+ {
171
+ " compilerOptions" : {
172
+ " target" : " es2022" ,
173
+ " module" : " es2022" ,
174
+ " moduleResolution" : " node" ,
175
+ }
176
+ }
177
+ ` ` `
170
178
171
- :::code language= " javascript " source= " ~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/js/src/index-using-password.mjs " :::
179
+ 1. Transpile from TypeScript to JavaScript.
172
180
173
- ---
181
+ ` ` ` shell
182
+ tsc index.ts
183
+ ` ` `
184
+
185
+ 1. Sign in to Azure with the following command:
174
186
175
- # # Run the code
187
+ ` ` ` shell
188
+ az login
189
+ ` ` `
176
190
177
- 1. Sign in to Azure with ` az login ` .
191
+ 1. Run the code with the following command:
178
192
179
- 2. Run the code
193
+ ` ` ` shell
194
+ node index.js
195
+ ` ` `
180
196
181
- # ### [TypeScript ](#tab/typescript )
197
+ # ### [JavaScript without key ](#tab/javascript )
182
198
183
- Transpile from TypeScript to JavaScript.
199
+ 1. Create the ` index.js ` file with the following ** recommended ** passwordless JavaScript module (index.mjs):
184
200
185
- ` ` ` shell
186
- tsc index.ts
187
- ` ` `
201
+ :::code language=" javascript" source=" ~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/js/src/index.mjs" :::
188
202
189
- Run the JavaScript file.
203
+ 1. Run the JavaScript file.
190
204
191
- ` ` ` shell
192
- node index.js
193
- ` ` `
205
+ ` ` ` shell
206
+ node index.js
207
+ ` ` `
194
208
195
- # ### [JavaScript](#tab/javascript)
209
+ # ### [JavaScript with key ](#tab/javascript-key )
196
210
197
- Run the JavaScript file.
211
+ 1. To use the service key for authentication, you can create the ` index.js ` file with the following JavaScript module (index.mjs):
198
212
199
- ` ` ` shell
200
- node index.js
201
- ` ` `
213
+ :::code language=" javascript" source=" ~/azure-typescript-e2e-apps/quickstarts/azure-openai-assistants/js/src/index-using-password.mjs" :::
214
+
215
+ 1. Run the JavaScript file.
216
+
217
+ ` ` ` shell
218
+ node index.js
219
+ ` ` `
202
220
203
221
```
204
222
0 commit comments