Skip to content

Commit 2e6dcb9

Browse files
committed
chore: format code
1 parent f800029 commit 2e6dcb9

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

python/packages/autogen-ext/src/autogen_ext/tools/mcp/_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def serialize_item(item):
135135
return {"type": type, "resource": resource, "annotations": annotations}
136136
else:
137137
return str(item)
138+
138139
return json.dumps([serialize_item(item) for item in value])
139140

140141
def _format_errors(self, error: Exception) -> str:

python/packages/autogen-ext/tests/tools/test_mcp_tools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ async def test_adapter_from_server_params_with_return_value_as_string(
209209

210210
adapter = await StdioMcpToolAdapter.from_server_params(sample_server_params, "test_tool")
211211

212-
assert adapter.return_value_as_string(
212+
assert (
213+
adapter.return_value_as_string(
213214
[
214215
TextContent(
215216
text="this is a sample text",
@@ -231,7 +232,9 @@ async def test_adapter_from_server_params_with_return_value_as_string(
231232
annotations=Annotations(audience=["user"], priority=0.3),
232233
),
233234
]
234-
) == '[{"type": "text", "text": "this is a sample text", "annotations": {"audience": ["user", "assistant"], "priority": 0.7}}, {"type": "image", "data": "this is a sample base64 encoded image", "mimeType": "image/png", "annotations": null}, {"type": "resource", "resource": {"uri": "http://example.com/test", "mimeType": null, "text": "this is a sample text"}, "annotations": {"audience": ["user"], "priority": 0.3}}]'
235+
)
236+
== '[{"type": "text", "text": "this is a sample text", "annotations": {"audience": ["user", "assistant"], "priority": 0.7}}, {"type": "image", "data": "this is a sample base64 encoded image", "mimeType": "image/png", "annotations": null}, {"type": "resource", "resource": {"uri": "http://example.com/test", "mimeType": null, "text": "this is a sample text"}, "annotations": {"audience": ["user"], "priority": 0.3}}]'
237+
)
235238

236239

237240
@pytest.mark.asyncio

0 commit comments

Comments
 (0)