Skip to content

Commit d4a8223

Browse files
author
jer
committed
chore(a2a): fix unknown mime types
1 parent 8cc211a commit d4a8223

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/strands/multiagent/a2a/executor.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class StrandsA2AExecutor(AgentExecutor):
5555
"3g2": "three_gp"
5656
}
5757

58+
59+
5860
def __init__(self, agent: SAAgent):
5961
"""Initialize a StrandsA2AExecutor.
6062
@@ -218,6 +220,12 @@ def _get_file_format_from_mime_type(self, mime_type: str | None, file_type: str)
218220

219221
mime_type = mime_type.lower()
220222

223+
# Extract subtype from MIME type and check existing format mappings
224+
if '/' in mime_type:
225+
subtype = mime_type.split('/')[-1]
226+
if subtype in self.FORMAT_MAPPINGS:
227+
return self.FORMAT_MAPPINGS[subtype]
228+
221229
# Use mimetypes library to find extensions for the MIME type
222230
extensions = mimetypes.guess_all_extensions(mime_type)
223231

0 commit comments

Comments
 (0)