Skip to content

Python: docs(core): fix positional invocations in detect_media_type_from_base64 docstrings - #8614

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/types-detect-media-type-docstring
Sep 22, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
ManoharPaturi:fix/types-detect-media-type-docstring

Conversation

@ManoharPaturi

@ManoharPaturi Manohar Paturi (ManoharPaturi) commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Motivation & Context

The function signature of detect_media_type_from_base64 uses keyword-only arguments (*, data_bytes, data_str, data_uri).

The docstring code examples on detect_media_type_from_base64 and Content.from_data previously passed string arguments positionally. If a developer copied and executed the docstring code directly, Python raised a TypeError: detect_media_type_from_base64() takes 0 positional arguments but 1 was given.

Updating these examples to supply data_str= and data_uri= keyword arguments ensures the documentation is accurate and runnable as written.

Description & Review Guide

  • What are the major changes?
    In python/packages/core/agent_framework/_types.py, updated docstring examples for detect_media_type_from_base64 and Content.from_data to invoke detect_media_type_from_base64 using data_str=... or data_uri=... keyword arguments instead of positional arguments.

  • What is the impact of these changes?
    Documentation examples will run without raising TypeError.

  • What do you want reviewers to focus on?
    Docstring example consistency with the function's keyword-only signature in python/packages/core/agent_framework/_types.py.

Related Issue

None

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 is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • 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.

…64 docstrings

The function signature of detect_media_type_from_base64 uses keyword only arguments (*). The code examples in the docstrings of detect_media_type_from_base64 and Content.from_data passed string variables positionally, which raises a TypeError when executed directly. Updating the examples to pass data_str and data_uri keyword arguments ensures the documentation samples run cleanly.

Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>

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 Sep 21, 2026
@github-actions github-actions Bot changed the title docs(core): fix positional invocations in detect_media_type_from_base64 docstrings Python: docs(core): fix positional invocations in detect_media_type_from_base64 docstrings Sep 21, 2026
@eavanvalkenburg

Copy link
Copy Markdown
Member

Manohar Paturi (@ManoharPaturi) Thanks for the contribution. Before this can move forward, please update the PR body to use the repository’s current PR template and complete its Motivation & Context, Description & Review Guide, Related Issue, and Contribution Checklist sections.

@ManoharPaturi

Copy link
Copy Markdown
Contributor Author

Eduard van Valkenburg (@eavanvalkenburg) Thanks for the heads up. I have updated the PR description with the repository template, including Motivation & Context, Description & Review Guide, and the Contribution Checklist.

Merged via the queue into microsoft:main with commit 17b349f Sep 22, 2026
50 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — 7d9ff739 Deployed Sep 22, 2026 by ManoharPaturi via add_label #23532
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