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: python/samples/02-agents/middleware/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,8 @@ This folder contains focused middleware samples for `Agent`, chat clients, tools
13
13
|[`exception_handling_with_middleware.py`](./exception_handling_with_middleware.py)| Shows how middleware can handle failures and recover cleanly. |
14
14
|[`function_based_middleware.py`](./function_based_middleware.py)| Shows function-based agent and function middleware. |
15
15
|[`middleware_termination.py`](./middleware_termination.py)| Demonstrates stopping a middleware pipeline early. |
16
-
|[`override_result_with_middleware.py`](./override_result_with_middleware.py)| Shows how middleware can replace the normal result. |
17
-
|[`runtime_context_delegation.py`](./runtime_context_delegation.py)| Demonstrates delegating work with runtime context data. |
16
+
|[`override_result_with_middleware.py`](./override_result_with_middleware.py)| Shows how middleware can replace regular and streaming results, then post-process the final response. |
17
+
|[`runtime_context_delegation.py`](./runtime_context_delegation.py)| Demonstrates delegating arguments with runtime context data. |
18
18
|[`session_behavior_middleware.py`](./session_behavior_middleware.py)| Shows how middleware interacts with session-backed runs. |
19
19
|[`shared_state_middleware.py`](./shared_state_middleware.py)| Demonstrates sharing mutable state across middleware invocations. |
20
20
|[`usage_tracking_middleware.py`](./usage_tracking_middleware.py)| Demonstrates one chat middleware function that tracks per-call usage in non-streaming and streaming tool-loop runs. |
# NOTE: approval_mode="never_require" is for sample brevity. Use "always_require" in production; see samples/02-agents/tools/function_tool_with_approval.py and samples/02-agents/tools/function_tool_with_approval_and_sessions.py.
96
+
# NOTE: approval_mode="never_require" is for sample brevity. Use "always_require" in production.
89
97
@tool(approval_mode="never_require")
90
98
asyncdefsend_email(
91
99
to: Annotated[str, Field(description="Recipient email address")],
0 commit comments