Python: [Bug]: Media type detection documentation examples contain invalid base64
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Description
The public detect_media_type_from_base64 docstring includes two examples whose base64 payloads end in .... Executing either raises ValueError: Invalid base64 data provided. instead of returning the documented image/png value.
Minimal reproduction
from agent_framework import detect_media_type_from_base64
detect_media_type_from_base64(data_str="iVBORw0KGgo...")
detect_media_type_from_base64(data_uri="data:image/png;base64,iVBORw0KGgo...")
Each call fails independently. The detector validates base64 input, so abbreviated payloads cannot be executed as written.
Expected behavior and proposed fix
Use the valid base64-encoded PNG signature iVBORw0KGgo= in both documentation examples. The function identifies magic bytes, so those signature bytes are sufficient to demonstrate detection; they are not a complete image file. This is a documentation-only correction with no runtime or API changes.
Verification
Reproduced on Python 3.13.16 against main commit 40763bed1a5e94a1698ba9ebf009e5622eb099aa. Both code examples were extracted from the source docstring and executed locally. They fail before the correction and each returns image/png afterward. No model calls, credentials, or services were used.
I am preparing the focused documentation correction and checked for an existing overlapping issue or PR. Report and patch prepared with assistance from OpenAI Codex.
- Dominant language
- Python
- Stars
- 13.9k
- Forks
- 2.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 439
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/agent-framework
-
.NET python triage
Difficulty 1/5 Under an hour Newbie friendliness 85/100
microsoft/agent-framework#9092 · 1 comment ·
Maintainers usually reply within 1 day
-
Python: raw-data content mappings lose annotations and attachment metadataPossibly taken @moonbox3 claimed this 9 days ago. Openpython triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/agent-framework#8632 · 2 comments ·
Maintainers usually reply within 1 day
-
Python: Clarify when to use platformPossibly taken @eavanvalkenburg claimed this 9 days ago. Openpython triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/agent-framework#8599 · 1 comment ·
Maintainers usually reply within 1 day
-
.NET Compaction - Update docs to refer to `AIContextProvider` deep divePossibly taken A pull request linked to this issue is open or already merged. Open.NET compaction documentation
Difficulty 1/5 Under an hour Newbie friendliness 82/100
microsoft/agent-framework#4629 · 1 comment ·
Maintainers usually reply within 1 day
-
Python: [Feature]: Official first-class TypeScript SDK supportPossibly taken @rogerbarreto claimed this today. Open.NET agents python
microsoft/agent-framework#9226 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in microsoft/agent-framework
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[BUG] Multi-day events show "Ended" while still in progressPossibly taken @tarunagnihotri534 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
data-umbrella/du-event-board#231 · 2 comments ·
-
avl_automation: the generated control surface block isn't valid XML (typo in avl_out_parse.py)Possibly taken @brksol claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
PX4/PX4-gazebo-models#164 ·