Skip to content

Commit 8e357c7

Browse files
moonbox3MAF Dashboard Bot
andauthored
Update agent framework docs for GA: middleware, providers, orchestrations, and Python parity (#928)
* Update agent framework docs for GA: middleware, providers, orchestrations, and Python parity Source issue: microsoft/agent-framework#4806 * Address review feedback for #928: review comment fixes * Address review feedback for #928: review comment fixes --------- Co-authored-by: MAF Dashboard Bot <maf-dashboard-bot@users.noreply.github.com>
1 parent c282260 commit 8e357c7

4 files changed

Lines changed: 51 additions & 30 deletions

File tree

agent-framework/agents/agent-pipeline.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ zone_pivot_groups: programming-languages
55
author: eavanvalkenburg
66
ms.topic: conceptual
77
ms.author: edvan
8-
ms.date: 03/11/2026
8+
ms.date: 03/20/2026
99
ms.service: agent-framework
1010
---
1111

@@ -45,8 +45,8 @@ The `Agent` class builds a pipeline through class composition with two main comp
4545

4646
**ChatClient** (separate and interchangeable component):
4747

48-
1. **Chat Middleware + Telemetry** - Optional middleware chain and instrumentation layers
49-
2. **FunctionInvocation** - Handles tool calling loop, invoking Function Middleware + Telemetry per tool call
48+
1. **FunctionInvocation** - Handles tool calling loop, invoking Function Middleware + Telemetry per tool call
49+
2. **Chat Middleware + Telemetry** - Optional middleware chain and instrumentation layers, running per model call
5050
3. **RawChatClient** - Provider-specific implementation (Azure OpenAI, OpenAI, Anthropic, etc.) that communicates with the LLM
5151

5252
When you call `run()`, your request flows through the Agent layers, then into the ChatClient pipeline for LLM communication.
@@ -231,9 +231,9 @@ When you invoke an agent, the request flows through the pipeline:
231231

232232
**ChatClient pipeline:**
233233

234-
4. **Chat Middleware + Telemetry** executes (if configured)
235-
5. **FunctionInvocation** sends request to the LLM and handles tool calling loop
234+
4. **FunctionInvocation** manages the tool calling loop
236235
- For each tool call, **Function Middleware + Telemetry** executes
236+
5. **Chat Middleware + Telemetry** executes per model call (if configured)
237237
6. **RawChatClient** handles provider-specific LLM communication
238238
7. Response flows back through the same layers
239239
8. **Context providers** are notified of new messages for storage

agent-framework/agents/middleware/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ zone_pivot_groups: programming-languages
55
author: dmytrostruk
66
ms.topic: reference
77
ms.author: dmytrostruk
8-
ms.date: 03/16/2026
8+
ms.date: 03/20/2026
99
ms.service: agent-framework
1010
---
1111

@@ -300,6 +300,9 @@ Chat middleware intercepts chat requests sent to AI models. It uses the `ChatCon
300300

301301
The `call_next` callback continues to the next middleware or sends the request to the AI service.
302302

303+
> [!NOTE]
304+
> Chat middleware runs inside the function invocation loop. This means it executes for **each model call**, including calls that send tool results back to the model during a multi-turn tool calling sequence.
305+
303306
### Function-based
304307

305308
```python

agent-framework/media/agent-pipeline-python.svg

Lines changed: 21 additions & 21 deletions
Loading

agent-framework/support/upgrade/python-2026-significant-changes.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Guide to significant changes in Python releases for Microsoft Agent
44
author: eavanvalkenburg
55
ms.topic: upgrade-and-migration-article
66
ms.author: edvan
7-
ms.date: 03/13/2026
7+
ms.date: 03/20/2026
88
ms.service: agent-framework
99
---
1010
# Python 2026 Significant Changes Guide
@@ -18,9 +18,27 @@ This document will be removed once we reach the 1.0.0 stable release, so please
1818

1919
---
2020

21-
## python-1.0.0rc5 / python-1.0.0b260318 (March 18, 2026)
21+
## python-1.0.0rc5 / python-1.0.0b260319 (March 19, 2026)
2222

23-
**Release:** Scheduled for March 18, 2026. `agent-framework-core` and `agent-framework-azure-ai` move to `1.0.0rc5`; the remaining Python packages align on the March 2026 build line (`1.0.0b260318`).
23+
### 🔴 Chat client pipeline reordered: FunctionInvocation now wraps ChatMiddleware
24+
25+
**PR:** [#4746](https://github.com/microsoft/agent-framework/pull/4746)
26+
27+
The ChatClient pipeline ordering has changed. `FunctionInvocation` is now the outermost layer and wraps `ChatMiddleware`, which means chat middleware runs **per model call** (including each iteration of the tool calling loop) instead of once around the entire function invocation sequence.
28+
29+
**Old pipeline order:**
30+
```
31+
ChatMiddleware → FunctionInvocation → RawChatClient
32+
```
33+
34+
**New pipeline order:**
35+
```
36+
FunctionInvocation → ChatMiddleware → ChatTelemetry → RawChatClient
37+
```
38+
39+
If you have custom chat middleware that assumed it ran only once per agent invocation (wrapping the entire tool calling loop), update it to be safe for repeated execution. Chat middleware is now invoked for each individual LLM request, including requests that send tool results back to the model.
40+
41+
Additionally, `ChatTelemetry` is now a separate layer from `ChatMiddleware` in the pipeline, running closest to `RawChatClient`.
2442

2543
### 🔴 Public runtime kwargs split into explicit buckets
2644

0 commit comments

Comments
 (0)