Skip to content

Commit 9ce3a7d

Browse files
Merge pull request #5328 from aahill/agents-doc-fixes
Agents doc fixes
2 parents e5cfb4a + c747b8a commit 9ce3a7d

File tree

5 files changed

+42
-34
lines changed

5 files changed

+42
-34
lines changed

articles/ai-services/agents/how-to/metrics.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Monitor Azure AI Foundry Agent Service
33
description: Start here to learn how to use Azure Monitor to capture and analyze metrics for your Azure AI Foundry Agent Service.
4-
ms.date: 03/20/2025
4+
ms.date: 06/02/2025
55
ms.custom: horz-monitor, subject-monitoring
66
ms.topic: conceptual
77
author: aahill
@@ -15,6 +15,9 @@ ms.service: azure-ai-agent-service
1515

1616
Monitoring is available for agents in a [standard agent setup](../concepts/standard-agent-setup.md).
1717

18+
> [!IMPORTANT]
19+
> Monitoring support is currently limited to Azure AI Foundry hubs. Azure AI Foundry projects are not supported.
20+
1821
## Dashboards
1922

2023
Azure AI Foundry Agent Service provides out-of-box dashboards. There are two key dashboards to monitor your resource:

articles/ai-services/agents/how-to/tools/azure-functions-samples.md

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Azure AI Agents supports function calling, which allows you to describe the stru
2222

2323
* A prepared environment. See the [overview](./azure-functions.md) article for details.
2424

25+
> [!NOTE]
26+
> You must have a [A deployed agent with the standard setup](../../environment-setup.md#choose-your-setup). The basic agent setup is not supported.
2527
2628
::: zone pivot="python"
2729

@@ -30,38 +32,30 @@ Azure AI Agents supports function calling, which allows you to describe the stru
3032
3133
## Define a function for your agent to call
3234

33-
Start by defining an Azure Function queue trigger function that will process function calls from the queue. For example this sample in Python:
35+
Start by defining an Azure Function queue trigger function that will process function calls from the queue. For example:
3436

3537
```python
36-
# Function to get the weather from an Azure Storage queue where the AI Agent will send function call information
37-
# It returns the mock weather to an output queue with the correlation id for the Foundry Agent Service to pick up the result of the function call
38-
@app.function_name(name="GetWeather")
39-
@app.queue_trigger(arg_name="msg", queue_name="input", connection="STORAGE_CONNECTION")
40-
def process_queue_message(msg: func.QueueMessage) -> None:
41-
logging.info('Python queue trigger function processed a queue item')
42-
43-
# Queue to send message to
44-
queue_client = QueueClient(
45-
os.environ["STORAGE_CONNECTION__queueServiceUri"],
46-
queue_name="output",
47-
credential=DefaultAzureCredential(),
48-
message_encode_policy=BinaryBase64EncodePolicy(),
49-
message_decode_policy=BinaryBase64DecodePolicy()
50-
)
51-
52-
# Get the content of the function call message
53-
messagepayload = json.loads(msg.get_body().decode('utf-8'))
54-
location = messagepayload['location']
55-
correlation_id = messagepayload['CorrelationId']
38+
app = func.FunctionApp()
39+
40+
@app.queue_trigger(arg_name="msg", queue_name="azure-function-foo-input", connection="STORAGE_CONNECTION")
41+
@app.queue_output(arg_name="outputQueue", queue_name="azure-function-foo-output", connection="STORAGE_CONNECTION")
42+
43+
def queue_trigger(inputQueue: func.QueueMessage, outputQueue: func.Out[str]):
44+
try:
45+
messagepayload = json.loads(inputQueue.get_body().decode("utf-8"))
46+
logging.info(f'The function receives the following message: {json.dumps(messagepayload)}')
47+
location = messagepayload["location"]
48+
weather_result = f"Weather is {len(location)} degrees and sunny in {location}"
49+
response_message = {
50+
"Value": weather_result,
51+
"CorrelationId": messagepayload["CorrelationId"]
52+
}
53+
logging.info(f'The function returns the following message through the {outputQueue} queue: {json.dumps(response_message)}')
5654

57-
# Send message to queue. Sends a mock message for the weather
58-
result_message = {
59-
'Value': 'Weather is 74 degrees and sunny in ' + location,
60-
'CorrelationId': correlation_id
61-
}
62-
queue_client.send_message(json.dumps(result_message).encode('utf-8'))
55+
outputQueue.set(json.dumps(response_message))
6356

64-
logging.info(f"Sent message to output queue with message {result_message}")
57+
except Exception as e:
58+
logging.error(f"Error processing message: {e}")
6559
```
6660

6761
## Configure the Azure Function tool
@@ -93,7 +87,7 @@ azure_function_tool = AzureFunctionTool(
9387
storage_service_endpoint=storage_service_endpoint,
9488
),
9589
output_queue=AzureFunctionStorageQueue( # Output queue configuration
96-
queue_name="azure-function-tool-output",
90+
queue_name="azure-function-foo-output",
9791
storage_service_endpoint=storage_service_endpoint,
9892
),
9993
)

articles/ai-services/agents/how-to/tools/azure-functions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ To use all features of function calling including parallel functions, you need t
2727
## Prerequisites
2828

2929
* [Azure Functions Core Tools v4.x](/azure/azure-functions/functions-run-local)
30-
* [A deployed agent with the standard setup](../../quickstart.md)
31-
* The basic agent setup is not supported.
30+
* [A deployed agent with the standard setup](../../environment-setup.md#choose-your-setup)
31+
> [!NOTE]
32+
> The basic agent setup is not supported.
3233
* [Azurite](https://github.com/Azure/Azurite)
3334

3435
## Prepare your local environment

articles/ai-services/agents/how-to/tools/function-calling.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Azure AI Agents supports function calling, which allows you to describe the stru
3131

3232
## Define a function for your agent to call
3333
Start by defining a function for your agent to call. When you create a function for an agent to call, you describe its structure with any required parameters in a docstring.
34+
3435
```python
3536
import json
3637
import datetime
@@ -54,9 +55,15 @@ user_functions = {fetch_weather}
5455

5556
## Create a client and agent
5657

58+
<!--
5759
In the sample below we create a client and define a `toolset` which will be used to process the functions defined in `user_functions`.
5860
5961
`toolset`: When using the toolset parameter, you provide not only the function definitions and descriptions but also their implementations. The SDK will execute these functions within `create_and_run_process` or streaming. These functions will be invoked based on their definitions.
62+
-->
63+
64+
> [!NOTE]
65+
> You can find a streaming example on [GitHub](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-agents/samples/agents_streaming/sample_agents_stream_eventhandler_with_functions.py).
66+
6067

6168
```python
6269
import os, time
@@ -104,7 +111,7 @@ print(f"Created message, ID: {message['id']}")
104111
## Create a run and check the output
105112
```python
106113
# Create and process a run for the agent to handle the message
107-
run = project_client.agents.runs.create_and_process(thread_id=thread.id, agent_id=agent.id)
114+
run = project_client.agents.runs.create(thread_id=thread.id, agent_id=agent.id)
108115
print(f"Created run, ID: {run.id}")
109116

110117
# Poll the run status until it is completed or requires action
@@ -137,6 +144,9 @@ print("Deleted agent")
137144

138145
::: zone pivot="csharp"
139146

147+
> [!NOTE]
148+
> You can find a streaming example on [GitHub](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Agents.Persistent/samples/Sample8_PersistentAgents_FunctionsWithStreaming.md).
149+
140150
## Configure client and define functions
141151

142152
First, set up the configuration using `appsettings.json` and create a `PersistentAgentsClient`.

articles/ai-services/agents/how-to/tools/logic-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ project_client = AIProjectClient(
4747

4848
## Register the Logic App
4949

50-
Register the Logic App by providing its name and trigger details.
50+
Register the Logic App by providing its name and trigger details. You can find code for `AzureLogicAppTool` on[GitHub](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-agents/samples/utils/user_functions.py).
5151

5252
```python
5353
from user_logic_apps import AzureLogicAppTool

0 commit comments

Comments
 (0)