From d32a23a7afc479e7de313ba300ff42740786f2a7 Mon Sep 17 00:00:00 2001 From: Jeeho Lee Date: Thu, 8 Oct 2026 00:06:09 +0000 Subject: [PATCH 1/2] Python: Fix media detection documentation examples Assisted-by: OpenAI Codex --- python/packages/core/agent_framework/_types.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/packages/core/agent_framework/_types.py b/python/packages/core/agent_framework/_types.py index 4e24e79ea0b..1633f69b896 100644 --- a/python/packages/core/agent_framework/_types.py +++ b/python/packages/core/agent_framework/_types.py @@ -149,13 +149,13 @@ def detect_media_type_from_base64( from agent_framework import detect_media_type_from_base64 - # Detect from base64 string - base64_data = "iVBORw0KGgo..." + # Detect from the base64-encoded PNG signature + base64_data = "iVBORw0KGgo=" media_type = detect_media_type_from_base64(data_str=base64_data) # Returns: "image/png" # Works with data URIs too - data_uri = "data:image/png;base64,iVBORw0KGgo..." + data_uri = "data:image/png;base64,iVBORw0KGgo=" media_type = detect_media_type_from_base64(data_uri=data_uri) # Returns: "image/png" """ From aeed90ef791d1249a4f8bb4b615703db44447d02 Mon Sep 17 00:00:00 2001 From: Jeeho Lee Date: Tue, 13 Oct 2026 06:58:36 +0000 Subject: [PATCH 2/2] Fix the remaining media-detection argument example Assisted-by: OpenAI Codex --- python/packages/core/agent_framework/_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/packages/core/agent_framework/_types.py b/python/packages/core/agent_framework/_types.py index 1633f69b896..fea995b0d92 100644 --- a/python/packages/core/agent_framework/_types.py +++ b/python/packages/core/agent_framework/_types.py @@ -133,7 +133,7 @@ def detect_media_type_from_base64( Args: data_bytes: Raw binary data. data_str: Base64-encoded data (without data URI prefix). - data_uri: Full data URI string (e.g., "data:image/png;base64,iVBORw0KGgo..."). + data_uri: Full data URI string (e.g., "data:image/png;base64,iVBORw0KGgo="). This will look at the actual data to determine the media_type and not at the URI prefix. Will also not compare those two values.