Skip to content

Commit

Permalink
pass page and page_size in query params (#2052)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-Khant authored Nov 25, 2024
1 parent 7284317 commit 86d3e36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mem0/client/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 86d3e36

Please sign in to comment.