File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
articles/ai-foundry/model-inference/includes Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -12,21 +12,35 @@ author: santiagxf
12
12
``` bash
13
13
npm install @azure-rest/ai-inference
14
14
npm install @azure/core-auth
15
+ npm install @azure/identity
15
16
```
16
17
17
- Alternately , you can add your dependencies to ** package.json** and install with ` npm rebuild ` :
18
+ If you are using Node.js , you can configure the dependencies in a ** package.json** file :
18
19
19
20
__ package.json__
20
21
21
22
``` json
22
23
{
23
- "name" : " sample_app " ,
24
+ "name" : " main_app " ,
24
25
"version" : " 1.0.0" ,
25
26
"description" : " " ,
26
27
"main" : " app.js" ,
28
+ "type" : " module" ,
27
29
"dependencies" : {
28
30
"@azure-rest/ai-inference" : " 1.0.0-beta.6" ,
29
- "@azure/core-auth" : " 1.9.0"
31
+ "@azure/core-auth" : " 1.9.0" ,
32
+ "@azure/core-sse" : " 2.2.0" ,
33
+ "@azure/identity" : " 4.8.0"
30
34
}
31
35
}
32
- ```
36
+ ```
37
+
38
+ * Import the following:
39
+
40
+ ``` javascript
41
+ import ModelClient from " @azure-rest/ai-inference" ;
42
+ import { isUnexpected } from " @azure-rest/ai-inference" ;
43
+ import { createSseStream } from " @azure/core-sse" ;
44
+ import { AzureKeyCredential } from " @azure/core-auth" ;
45
+ import { DefaultAzureCredential } from " @azure/identity" ;
46
+ ```
You can’t perform that action at this time.
0 commit comments