Skip to content

Python: Import Content in the ChatResponse.from_updates example - #9201

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
BlueRaddish:docs/oct8-runnable-example
Oct 9, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
BlueRaddish:docs/oct8-runnable-example

Conversation

@BlueRaddish

Copy link
Copy Markdown
Contributor

Motivation & Context

Copying the ChatResponse.from_updates documentation example into a clean Python namespace raises NameError because it uses Content.from_text(...) without importing Content.

Description & Review Guide

  • What are the major changes? Add Content to the example's existing import statement.
  • What is the impact of these changes? The copied example runs and prints Hello How can I help you?. Runtime implementation and public APIs are unchanged.
  • What do you want reviewers to focus on? The import now includes every public type used by the example.

The actual source docstring block was extracted and executed: it fails with NameError before the correction and prints the documented result afterward. All normal scoped native prek hooks pass. No credentials, model calls, or services were used.

Related Issue

Fixes #9200.

This is a trivial documentation correction: the example already uses Content and the missing import has an unambiguous result. It qualifies for the trivial-change exception in the Contribution Guidelines. Related open PRs, including #8985, do not include this import correction.

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 issue analysis, the documentation correction, local verification, and this PR 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 balanced review requested due to automatic review settings October 8, 2026 12:10

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.

@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)): 0ec736005e82
Model: gpt-5.6-sol

Overview

This PR adds Content to the ChatResponse.from_updates docstring import, making the example self-contained without changing runtime behavior. Content is already exposed through the package's runtime and type-checking export surfaces, and existing tests cover the demonstrated aggregation behavior. No Critical, High, or Medium issue was identified.

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.

Merged via the queue into microsoft:main with commit c2c8d36 Oct 9, 2026
52 of 53 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — 0ec73600 Deployed Oct 8, 2026 by BlueRaddish via team_check #6363
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.

Python: ChatResponse.from_updates documentation example omits Content import

3 participants