Skip to content

Commit 77c9cbf

Browse files
Merge pull request #2697 from diberry/diberry/0203-fix-js-ai-project
AI Projects - QS -JS - Fixes
2 parents 24b53dc + c3f54d8 commit 77c9cbf

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

articles/ai-services/agents/includes/quickstart-javascript.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: aahill
44
ms.author: aahi
55
ms.service: azure-ai-agent-service
66
ms.topic: include
7-
ms.date: 01/28/2025
7+
ms.date: 02/03/2025
88
ms.custom: devx-track-js
99
---
1010

@@ -38,6 +38,12 @@ npm install @azure/ai-projects
3838
npm install @azure/identity
3939
```
4040

41+
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.
42+
43+
```azurecli
44+
az login
45+
```
46+
4147
Use the following code to create and run an agent. To run this code, you will need to create a connection string using information from your project. This string is in the format:
4248

4349
`<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<ProjectName>`
@@ -87,7 +93,7 @@ export async function main() {
8793
const codeInterpreterTool = ToolUtility.createCodeInterpreterTool();
8894

8995
// Step 2 an agent
90-
const agent = await client.agents.createAgent("gpt-35-turbo", {
96+
const agent = await client.agents.createAgent("gpt-4o-mini", {
9197
name: "my-agent",
9298
instructions: "You are a helpful agent",
9399
tools: [codeInterpreterTool.definition],
@@ -143,7 +149,7 @@ export async function main() {
143149
// messages[0] is the most recent
144150
for (let i = messages.data.length - 1; i >= 0; i--) {
145151
const m = messages.data[i];
146-
if (isOutputOfType<MessageTextContentOutput>(m.content[0], "text")) {
152+
if (isOutputOfType(m.content[0], "text")) {
147153
const textContent = m.content[0];
148154
console.log(`${textContent.text.value}`);
149155
console.log(`---------------------------------`);

articles/ai-services/agents/includes/quickstart-typescript.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: aahill
44
ms.author: aahi
55
ms.service: azure-ai-agent-service
66
ms.topic: include
7-
ms.date: 01/28/2025
7+
ms.date: 02/03/2025
88
ms.custom: devx-track-ts
99
---
1010

@@ -39,6 +39,12 @@ npm install @azure/ai-projects
3939
npm install @azure/identity
4040
```
4141

42+
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.
43+
44+
```azurecli
45+
az login
46+
```
47+
4248
Use the following code to create and run an agent. To run this code, you will need to create a connection string using information from your project. This string is in the format:
4349

4450
`<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<ProjectName>`
@@ -93,7 +99,7 @@ export async function main(): Promise<void> {
9399
const codeInterpreterTool = ToolUtility.createCodeInterpreterTool();
94100

95101
// Step 2: Create an agent
96-
const agent = await client.agents.createAgent("gpt-35-turbo", {
102+
const agent = await client.agents.createAgent("gpt-4o-mini", {
97103
name: "my-agent",
98104
instructions: "You are a helpful agent",
99105
tools: [codeInterpreterTool.definition],

0 commit comments

Comments
 (0)