Skip to content

Python: Make response overview examples runnable - #9617

Open
BlueRaddish wants to merge 1 commit into
microsoft:mainfrom
BlueRaddish:fix/oct22-mm-response-docs
Open

BlueRaddish wants to merge 1 commit into
microsoft:mainfrom
BlueRaddish:fix/oct22-mm-response-docs

Conversation

@BlueRaddish

Copy link
Copy Markdown
Contributor

Motivation & Context

The ChatResponse and AgentResponse overview code blocks use an illustrative updates = [...] placeholder. Copying either complete block stops at from_updates before its serialization examples because Ellipsis is not a response update. Concrete updates let readers run each overview as written.

Description & Review Guide

  • What are the major changes? Import the corresponding update class and Content, then construct a single assistant text update in each overview.
  • What is the impact of these changes? Both complete examples run through streaming aggregation and dictionary/JSON round trips. Their documented text, model, finish reason and response ID are preserved. Only two class docstrings change; the runtime AST and public API are identical.
  • What do you want reviewers to focus on? The complete examples remain self-contained, and the concrete stream produces the same values used by the later serialization demonstrations.

Actual verification catches two AttributeError interruptions when copying the original complete blocks, with three passing public API controls. Both final blocks execute through real public imports, including their printed values and both serialization round trips. The actual code blocks compile under Python 3.10 and 3.11. All 482 owning test_types.py unit tests pass with zero skips. Normal scoped hooks and the native source commit's normal pre-commit hook pass. Exact source verification. Runtime execution used Ubuntu/CPython 3.13; the full workspace suite, build, typing and live service calls were not run.

Related Issue

N/A - trivial change. This replaces illustrative placeholders with minimal concrete inputs in existing overview examples; runtime behavior is unchanged. The separate #9437 edits the to_updates method examples, not these class overviews. Fresh targeted issue/PR searches found no competing overview repair.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: OpenAI Codex assisted with the example inputs, documentation patch, verification and this description.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Oct 23, 2026
@eavanvalkenburg

Copy link
Copy Markdown
Member

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): d6cfbe00c854
Model: gpt-5.6-sol

Overview

This PR replaces non-runnable Ellipsis placeholders in two class docstrings with concrete response updates that exercise aggregation and serialization. The imported symbols are valid public exports, the examples match the aggregation contracts, and existing tests cover the relevant text, metadata, and round-trip behavior; no publishable defect was established.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

This branch was previously deployed

1 inactive deployment
github-app-auth — d6cfbe00 Deployed Oct 23, 2026 by BlueRaddish via team_check #7300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants