Skip to content

Commit f3ad5d1

Browse files
Merge pull request #2553 from aahill/agents-fixes
updating quickstarts
2 parents 227eae6 + c77e49b commit f3ad5d1

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ dotnet add package Azure.AI.Projects
3838
dotnet add package 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>`
@@ -56,6 +62,7 @@ For example, your connection string may look something like:
5662

5763
Set this connection string as an environment variable named `PROJECT_CONNECTION_STRING`.
5864

65+
5966
```csharp
6067
// Copyright (c) Microsoft Corporation. All rights reserved.
6168
// Licensed under the MIT License.

articles/ai-services/agents/includes/quickstart-python-openai.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ pip install azure-identity
4141
pip install openai
4242
```
4343

44+
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.
45+
46+
```azurecli
47+
az login
48+
```
49+
4450
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:
4551

4652
`<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<ProjectName>`

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ Run the following commands to install the python packages.
3838
pip install azure-ai-projects
3939
pip install azure-identity
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+
```
4146

4247
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:
4348

@@ -115,7 +120,7 @@ with project_client:
115120
print(f"Messages: {messages}")
116121

117122
# Get the last message from the sender
118-
last_msg = messages.get_last_text_message_by_sender("assistant")
123+
last_msg = messages.get_last_text_message_by_role("assistant")
119124
if last_msg:
120125
print(f"Last Message: {last_msg.text.value}")
121126

0 commit comments

Comments
 (0)