From 7d9ff7392104a3e1f88850176b8598bad7724589 Mon Sep 17 00:00:00 2001 From: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com> Date: Mon, 21 Sep 2026 23:20:56 +0530 Subject: [PATCH] docs(core): fix positional invocations in detect_media_type_from_base64 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> --- python/packages/core/agent_framework/_types.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/packages/core/agent_framework/_types.py b/python/packages/core/agent_framework/_types.py index d2ed7de92c1..0374b41e0f6 100644 --- a/python/packages/core/agent_framework/_types.py +++ b/python/packages/core/agent_framework/_types.py @@ -113,12 +113,12 @@ def detect_media_type_from_base64( # Detect from base64 string base64_data = "iVBORw0KGgo..." - media_type = detect_media_type_from_base64(base64_data) + 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..." - media_type = detect_media_type_from_base64(data_uri) + media_type = detect_media_type_from_base64(data_uri=data_uri) # Returns: "image/png" """ data: bytes | None = None @@ -714,7 +714,7 @@ def from_data( from agent_framework import detect_media_type_from_base64, Content - media_type = detect_media_type_from_base64(base64_string) + media_type = detect_media_type_from_base64(data_str=base64_string) if media_type is None: raise ValueError("Could not detect media type") data_bytes = base64.b64decode(base64_string) @@ -743,7 +743,7 @@ def from_data( # If you have a base64 string and need to detect media type base64_string = "iVBORw0KGgo..." - media_type = detect_media_type_from_base64(base64_string) + media_type = detect_media_type_from_base64(data_str=base64_string) if media_type is None: raise ValueError("Unknown media type") image_bytes = base64.b64decode(base64_string)