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
First, initialize a new TypeScript project by running:
37
35
38
36
```console
39
37
npm init -y
38
+
npm pkg set type="module"
40
39
```
41
40
42
41
Run the following commands to install the npm packages required.
43
42
44
43
```console
45
44
npm install @azure/ai-agents @azure/identity
46
-
npm install dotenv
45
+
npm install @types/node typescript --save-dev
47
46
```
48
47
49
48
Next, to authenticate your API requests and run the program, use the [az login](/cli/azure/authenticate-azure-cli-interactively) command to sign into your Azure subscription.
@@ -52,7 +51,7 @@ Next, to authenticate your API requests and run the program, use the [az login](
52
51
az login
53
52
```
54
53
55
-
Use the following code to create and run an agent which uploads [a CSV file](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/ai/ai-agents/data/syntheticCompanyQuarterlyResults.csv) of data then generates a bar chart from that data. To run this code, you'll need to get the endpoint for your project. This string is in the format:
54
+
Use the following code to answer the math question `I need to solve the equation '3x + 11 = 14'. Can you help me?`. To run this code, you'll need to get the endpoint for your project. This string is in the format:
@@ -68,190 +67,12 @@ Save the name of your model deployment name as an environment variable named `MO
68
67
> * This quickstart code uses environment variables for sensitive configuration. Never commit your `.env` file to version control by making sure `.env` is listed in your `.gitignore` file.
69
68
> *_Remember: If you accidentally commit sensitive information, consider those credentials compromised and rotate them immediately._
70
69
70
+
Create a tsconfig.json file with the following content:
71
71
72
-
Next, create an `index.js` file and paste in the following code:
73
-
74
-
```typescript
75
-
// Copyright (c) Microsoft Corporation.
76
-
// Licensed under the MIT License.
77
-
78
-
/**
79
-
* This sample demonstrates how to use agent operations with code interpreter from the Azure Agents service.
80
-
*
81
-
* @summary demonstrates how to use agent operations with code interpreter.
Run the code using `node index.js`. This code generates a bar chart PNG image file in the TRANSPORTATION sector for the operating profit from the uploaded CSV file and provided the file to you. Full [sample source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/ai/ai-agents/samples/v1-beta/typescript/src/codeInterpreterWithStreaming.ts) available.
78
+
Run the code using `npx tsx -r dotenv/config index.ts`. This code answers the question `I need to solve the equation '3x + 11 = 14'. Can you help me?`. Full [sample source code](https://github.com/Azure-Samples/azure-sdk-for-js-docs/blob/main/samples/foundry/azure-ai-agents-quickstart-math) available.
0 commit comments