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
Copy file name to clipboardExpand all lines: agent-framework/agents/conversations/compaction.md
+2-5Lines changed: 2 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ Compaction solves these problems by selectively removing, collapsing, or summari
59
59
60
60
Compaction applies only to agents that manage their own conversation history in memory. Agents that rely on service-managed context or conversation state do not benefit from compaction because the service already handles context management. Examples of service-managed agents include:
61
61
62
-
-**Foundry Agents** — context is managed server-side by the Azure AI Foundry service.
62
+
-**Foundry Agents** — context is managed server-side by the Microsoft Foundry service.
63
63
-**Responses API with store enabled** (the default) — conversation state is stored and managed by the OpenAI service.
64
64
-**Copilot Studio agents** — conversation context is maintained by the Copilot Studio service.
> This example shows using the AzureOpenAIResponsesClient, but the same pattern applies to any chat client that implements `SupportsChatGetResponse`, see [providers overview](./providers/index.md) for more details on other clients.
250
+
> This example shows using the FoundryChatClient, but the same pattern applies to any chat client that implements `SupportsChatGetResponse`, see [providers overview](./providers/index.md) for more details on other clients.
243
251
244
252
For detailed examples, see the agent-specific documentation sections below.
245
253
@@ -293,17 +301,17 @@ You can provide function tools to agents for enhanced capabilities:
293
301
import os
294
302
from typing import Annotated
295
303
from azure.identity.aio import DefaultAzureCredential
296
-
from agent_framework.azureimportAzureOpenAIResponsesClient
304
+
from agent_framework.foundryimportFoundryChatClient
297
305
298
306
defget_weather(location: Annotated[str, "The location to get the weather for."]) -> str:
299
307
"""Get the weather for a given location."""
300
308
returnf"The weather in {location} is sunny with a high of 25°C."
Copy file name to clipboardExpand all lines: agent-framework/agents/middleware/agent-vs-run-scope.md
+41-6Lines changed: 41 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ When both are registered, agent-level middleware runs first (outermost), followe
20
20
21
21
:::zone pivot="programming-language-csharp"
22
22
23
-
In C#, middleware is registered on an agent using the builder pattern. Agent-level middleware is applied during agent construction, while run-level middleware can be provided via `AgentRunOptions`.
23
+
In C#, middleware is registered on an agent using the builder pattern with `.AsBuilder().Use(...).Build()`. Agent-level middleware is applied during agent construction and persists across all runs. Run-level middleware uses the same pattern but builds a decorated agent inline before calling `RunAsync` or `RunStreamingAsync`.
24
24
25
25
### Agent-level middleware
26
26
@@ -30,6 +30,7 @@ Agent-level middleware is registered at construction time and applies to every r
> The `.AsBuilder().Use(...).Build()` pattern creates a lightweight wrapper around the original agent. You can chain multiple `.Use()` calls to compose several middleware for a single invocation.
0 commit comments