-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Summary
PR #4746 refactored the middleware layering in the Python SDK and split the Anthropic client into raw/public variants. Several documentation artifacts need to be updated to reflect these changes.
Changes from PR #4746 that require doc updates
-
Middleware pipeline reordering — The public chat client stack is now
FunctionInvocationLayer -> ChatMiddlewareLayer -> ChatTelemetryLayer -> Raw/Base client. Documentation describing the old middleware ordering needs to be updated. -
Chat middleware now runs per inner model call — Chat middleware executes for each inner model call in the function loop (outside telemetry so middleware latency does not skew per-call timings). Any docs describing middleware execution semantics should reflect this.
-
Per-call middleware routing via
client_kwargs["middleware"]— Mixed per-call middleware is now standardized onclient_kwargs["middleware"]. References to the oldfunction_middlewareparameter in docs/docstrings should be removed. -
Anthropic raw/public client split —
AnthropicClientis now split intoRawAnthropicClient+ publicAnthropicClient, matching the pattern used by other providers. Provider documentation and any Anthropic-specific guides should be updated.
Docs to review and update
-
docs/decisions/0007-agent-filtering-middleware.md— ADR on middleware design; verify the described pipeline ordering and execution semantics still match. -
docs/decisions/0016-python-context-middleware.md— ADR on context middleware; check for any stale references to old middleware layering. -
python/AGENTS.mdand relevant package-levelAGENTS.mdfiles — Ensure public API references (e.g., Anthropic client names, middleware parameters) are current. - Any other docs referencing
function_middlewareor the old pipeline ordering.