Skip to content

Commit 9699881

Browse files
author
jer
committed
chore(a2a): lint/format
1 parent 811a1a8 commit 9699881

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/strands/multiagent/a2a/executor.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,7 @@ class StrandsA2AExecutor(AgentExecutor):
4646
DEFAULT_FORMATS = {"document": "txt", "image": "png", "video": "mp4", "unknown": "txt"}
4747

4848
# Handle special cases where format differs from extension
49-
FORMAT_MAPPINGS = {
50-
"jpg": "jpeg",
51-
"htm": "html",
52-
"3gp": "three_gp",
53-
"3gpp": "three_gp",
54-
"3g2": "three_gp"
55-
}
49+
FORMAT_MAPPINGS = {"jpg": "jpeg", "htm": "html", "3gp": "three_gp", "3gpp": "three_gp", "3g2": "three_gp"}
5650

5751
def __init__(self, agent: SAAgent):
5852
"""Initialize a StrandsA2AExecutor.
@@ -219,8 +213,8 @@ def _get_file_format_from_mime_type(self, mime_type: str | None, file_type: str)
219213
mime_type = mime_type.lower()
220214

221215
# Extract subtype from MIME type and check existing format mappings
222-
if '/' in mime_type:
223-
subtype = mime_type.split('/')[-1]
216+
if "/" in mime_type:
217+
subtype = mime_type.split("/")[-1]
224218
if subtype in self.FORMAT_MAPPINGS:
225219
return self.FORMAT_MAPPINGS[subtype]
226220

tests/strands/multiagent/a2a/test_executor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,9 @@ def non_serializable():
813813

814814

815815
@pytest.mark.asyncio
816-
async def test_execute_streaming_mode_raises_error_for_empty_content_blocks(mock_strands_agent, mock_event_queue, mock_request_context):
816+
async def test_execute_streaming_mode_raises_error_for_empty_content_blocks(
817+
mock_strands_agent, mock_event_queue, mock_request_context
818+
):
817819
"""Test that execute raises ServerError when content blocks are empty after conversion."""
818820
executor = StrandsA2AExecutor(mock_strands_agent)
819821

@@ -824,7 +826,7 @@ async def test_execute_streaming_mode_raises_error_for_empty_content_blocks(mock
824826
mock_request_context.message = mock_message
825827

826828
# Mock the conversion to return empty list
827-
with patch.object(executor, '_convert_a2a_parts_to_content_blocks', return_value=[]):
829+
with patch.object(executor, "_convert_a2a_parts_to_content_blocks", return_value=[]):
828830
with pytest.raises(ServerError) as excinfo:
829831
await executor.execute(mock_request_context, mock_event_queue)
830832

0 commit comments

Comments
 (0)