Python: Update docs for middleware layering refactor and Anthropic client split#4801
Python: Update docs for middleware layering refactor and Anthropic client split#4801LEDazzio01 wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…GENTS.md Fixes microsoft#4789 - Update python/packages/anthropic/AGENTS.md to document RawAnthropicClient and the layered client architecture - Add Chat Client Layer Architecture section to python/packages/core/AGENTS.md explaining the standard layer ordering (FunctionInvocationLayer -> ChatMiddlewareLayer -> ChatTelemetryLayer -> Raw/Base), per-call middleware routing via client_kwargs, and raw vs public client pattern
f30d9ba to
36b514d
Compare
There was a problem hiding this comment.
Pull request overview
Updates Python package documentation to reflect the middleware layering refactor and (intended) Anthropic raw/public client split described in #4746 / #4789.
Changes:
- Added a new “Chat Client Layer Architecture” section to
python/packages/core/AGENTS.mddescribing the layer stack and per-call middleware routing. - Expanded
python/packages/anthropic/AGENTS.mdwith a “Client Architecture” section and updated class/import listings to mention a raw client.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| python/packages/core/AGENTS.md | Adds an architecture section documenting the chat client layer stack and per-call middleware routing. |
| python/packages/anthropic/AGENTS.md | Updates Anthropic package docs to describe client architecture and add raw/public client references. |
|
Thanks for the thorough review, @copilot! All 6 comments reference the same root cause: this docs PR intentionally documents the changes introduced by PR #4746 Specifically:
This PR was created to address issue #4789, which was filed as a follow-up docs task for PR #4746. It should be merged after #4746 lands. I'll update the PR description to note this dependency explicitly. |
|
Appreciate the enthousiasm, but that issue was supposed to go to our docs repo, so closing this. |
Motivation and Context
Fixes #4789.
PR #4746 refactored the middleware layering in the Python SDK and split the Anthropic client into raw/public variants. This PR updates documentation artifacts to reflect those changes.
Description
python/packages/anthropic/AGENTS.mdRawAnthropicClientto the main classes listingRawAnthropicClientpython/packages/core/AGENTS.mdFunctionInvocationLayer → ChatMiddlewareLayer → ChatTelemetryLayer → Raw/BaseChatClientclient_kwargs={"middleware": [...]}Docs confirmed unchanged (no stale references found)
docs/decisions/0007-agent-filtering-middleware.md— C#-focused ADR, no Python layer ordering referencesdocs/decisions/0016-python-context-middleware.md— About context providers/hooks, no middleware layer referencespython/AGENTS.md— General index, no middleware-specific contentfunction_middlewarereferences found in any markdown documentationContribution Checklist