Python: [Bug]: Media type detection documentation examples contain invalid base64
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- Python
- 星标
- 13.9k
- 派生
- 2.4k
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 439
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/agent-framework 的其他 Issue
-
.NET python triage
难度 1/5 1 小时以内 新手友好度 85/100
microsoft/agent-framework#9092 · 1 条评论 ·
维护者通常 1 天内回复
-
Python: raw-data content mappings lose annotations and attachment metadata可能已有人在做 @moonbox3 于 9 天前认领。 未关闭python triage
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/agent-framework#8632 · 2 条评论 ·
维护者通常 1 天内回复
-
Python: Clarify when to use platform可能已有人在做 @eavanvalkenburg 于 9 天前认领。 未关闭python triage
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/agent-framework#8599 · 1 条评论 ·
维护者通常 1 天内回复
-
.NET Compaction - Update docs to refer to `AIContextProvider` deep dive可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭.NET compaction documentation
难度 1/5 1 小时以内 新手友好度 82/100
microsoft/agent-framework#4629 · 1 条评论 ·
维护者通常 1 天内回复
-
Python: [Feature]: Official first-class TypeScript SDK support可能已有人在做 @rogerbarreto 今天认领。 未关闭.NET agents python
microsoft/agent-framework#9226 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 microsoft/agent-framework 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
MystenLabs/MemWal#1163 · 2 条评论 ·
维护者通常 1 天内回复
-
infertopics leaves new nodes without a topic when untopiced neighbours outnumber topiced ones可能已有人在做 @moneebullah25 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
FinanceFlash/unvibecode#218 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
NVIDIA/earth2studio#1241 ·
维护者通常 3 天内回复