From 86d3e36ace3d77b2e1bbf2826be55487c9a87624 Mon Sep 17 00:00:00 2001 From: Dev Khant Date: Tue, 26 Nov 2024 00:00:49 +0530 Subject: [PATCH] pass page and page_size in query params (#2052) --- mem0/client/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mem0/client/main.py b/mem0/client/main.py index 32bbb92538..aa485da19c 100644 --- a/mem0/client/main.py +++ b/mem0/client/main.py @@ -167,7 +167,11 @@ def get_all(self, version: str = "v1", **kwargs) -> List[Dict[str, Any]]: if version == "v1": response = self.client.get(f"/{version}/memories/", params=params) elif version == "v2": - response = self.client.post(f"/{version}/memories/", json=params) + if "page" in params and "page_size" in params: + query_params = {"page": params.pop("page"), "page_size": params.pop("page_size")} + response = self.client.post(f"/{version}/memories/", json=params, params=query_params) + else: + response = self.client.post(f"/{version}/memories/", json=params) response.raise_for_status() if "metadata" in kwargs: del kwargs["metadata"]