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
| Trigger / target predicate system | ✅ | ❌ | C#-only: CompactionTrigger delegates control when each strategy fires and stops; Python strategies use internal parameters |
| Post-run compaction of persisted history | ❌ | ✅ | Python-only: CompactionProvider.after_strategy compacts stored history after each run; C# compacts in-flight context only |
26
+
-->
27
+
12
28
# Compaction
13
29
14
30
As conversations grow, the token count of the chat history can exceed model context windows or drive up costs. Compaction strategies reduce the size of conversation history while preserving important context, so agents can continue functioning over long-running interactions.
@@ -300,6 +300,9 @@ Chat middleware intercepts chat requests sent to AI models. It uses the `ChatCon
300
300
301
301
The `call_next` callback continues to the next middleware or sends the request to the AI service.
302
302
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.
> The `AzureOpenAIChatClient` and `AzureOpenAIAssistantsClient` require an **Azure OpenAI resource** endpoint (format: `https://<myresource>.openai.azure.com`). The `AzureOpenAIResponsesClient` can use either an Azure OpenAI resource endpoint **or** a [Microsoft Foundry project](/azure/ai-foundry/what-is-ai-foundry) endpoint (format: `https://<your-project>.services.ai.azure.com/api/projects/<project-id>`). If you need to use the Foundry Agent Service instead, see the [Foundry Agents provider page](./azure-ai-foundry.md).
153
+
151
154
Each client type uses different environment variables:
152
155
153
156
# [Chat Completion](#tab/aoai-chat-completion)
@@ -228,7 +231,7 @@ asyncio.run(main())
228
231
229
232
### Responses Client with Microsoft Foundry project endpoint
230
233
231
-
`AzureOpenAIResponsesClient` can also be created from a Foundry project endpoint:
234
+
Instead of an Azure OpenAI resource endpoint, `AzureOpenAIResponsesClient` can also be created from a [Microsoft Foundry project](/azure/ai-foundry/what-is-ai-foundry) endpoint. Use a Foundry project endpoint when you want to access models deployed through a Microsoft Foundry project rather than a standalone Azure OpenAI resource:
232
235
233
236
```python
234
237
from agent_framework.azure import AzureOpenAIResponsesClient
Copy file name to clipboardExpand all lines: agent-framework/agents/providers/microsoft-foundry.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,9 @@ For more information on how to run and interact with agents, see the [Agent gett
98
98
99
99
### Environment Variables
100
100
101
+
> [!IMPORTANT]
102
+
> `AzureAIAgentClient` (Foundry Agent Service v1) and `AzureAIClient` (Foundry Agent Service v2) both require an **Azure AI Foundry project** endpoint (format: `https://<your-project>.services.ai.azure.com/api/projects/<project-id>`), **not** an Azure OpenAI resource endpoint. You must have an [Azure AI Foundry project](/azure/ai-foundry/what-is-ai-foundry) to use this provider. If you have a standalone Azure OpenAI resource instead, see the [Azure OpenAI provider page](./azure-openai.md).
103
+
101
104
Before using Foundry Agents, you need to set up these environment variables:
**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
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.
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`.
24
42
25
43
### 🔴 Public runtime kwargs split into explicit buckets
0 commit comments