Handle pagination for GET_ALL (#2044)

This commit is contained in:
Dev Khant
2024-11-22 19:30:28 +05:30
committed by GitHub
parent 8c087fcabc
commit 9b55b717e0
2 changed files with 58 additions and 20 deletions

View File

@@ -176,7 +176,11 @@ class MemoryClient:
self,
{"api_version": version, "keys": list(kwargs.keys())},
)
return response.json()
data = response.json()
if "output_format" in kwargs and kwargs["output_format"] == "v1.0":
return data["results"]
else:
return data
@api_error_handler
def search(self, query: str, version: str = "v1", **kwargs) -> List[Dict[str, Any]]: