From ffb8e040ed19a879bf0bc231ad5010c9ccfc8180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=9A=D1=83=D1=82?= =?UTF-8?q?=D0=BB=D0=B0=D1=85=D0=BC=D0=B5=D1=82=D0=BE=D0=B2?= Date: Mon, 25 May 2026 21:04:32 +0000 Subject: [PATCH] Add solution for 69f8e929da860fb4533faa2a --- memory_client.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 memory_client.py diff --git a/memory_client.py b/memory_client.py new file mode 100644 index 0000000..ff49d86 --- /dev/null +++ b/memory_client.py @@ -0,0 +1,33 @@ +from __future__ import annotations + +import asyncio + +from fastmcp import Client + + +def unwrap(result): + return getattr(result, "data", result) + + +async def main(): + async with Client("memory_server.py") as client: + result = await client.call_tool( + "save_with_namespace", + {"key": "username", "value": "\u0410\u043b\u0435\u043a\u0441\u0435\u0439", "namespace": "default"}, + ) + print(f"Сохранено: {unwrap(result)}") + + result = await client.call_tool( + "get_by_namespace", + {"namespace": "default"}, + ) + print("Данные namespace 'default':") + for item in unwrap(result): + print(f" {item['key']}: {item['value']}") + + keys = await client.call_tool("list_keys", {"pattern": "*name"}) + print(f"Ключи с 'name': {unwrap(keys)}") + + +if __name__ == "__main__": + asyncio.run(main())