Skip to content

Python: Use the public URI constructor in the Message example - #9332

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
BlueRaddish:fix/oct12-ms-a
Oct 16, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
BlueRaddish:fix/oct12-ms-a

Conversation

@BlueRaddish

Copy link
Copy Markdown
Contributor

Motivation & Context

Copying the public Message example raises AttributeError because it calls Content.from_image_uri, which does not exist. The example stops before its serialization demonstrations.

Description & Review Guide

  • What are the major changes? Use the existing Content.from_uri constructor with a concrete PNG URL and its media type.
  • What is the impact of these changes? The complete documented example runs successfully, including mixed-content construction and both serialization round trips. Only the docstring changes; the runtime AST is unchanged. The actual public example failed before the change and passed on Windows Python 3.11.17 and Linux Python 3.13.16 afterward. Normal scoped repository hooks passed without changing the patch.
  • What do you want reviewers to focus on? The example uses the existing public URI constructor and still demonstrates an image alongside text.

Related Issue

N/A - trivial change. This corrects a nonexistent method in a public example; the intended constructor already exists.

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 diagnosis, the focused documentation correction, verification and this description. The contributor personally reviewed and verified this change.

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 13, 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)): 55b9e91a4151
Model: gpt-5.6-sol

Overview

The PR updates only the Message docstring example, replacing a nonexistent constructor with the existing public Content.from_uri API. The constructor accepts the example's HTTPS URI and explicit media type, and existing tests plus direct execution confirm mixed-content construction, text extraction, and serialization round trips without changing runtime behavior.

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 5dc7949 Oct 16, 2026
49 of 50 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — 55b9e91a Deployed Oct 13, 2026 by BlueRaddish via team_check #6685
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