Set output_format='v1.1' and update docs (#2480)

This commit is contained in:
Dev Khant
2025-04-02 10:35:29 +05:30
committed by GitHub
parent 91a28c7f04
commit 1db1105cad
2 changed files with 114 additions and 332 deletions

View File

@@ -130,13 +130,14 @@ class MemoryClient:
"""
kwargs = self._prepare_params(kwargs)
if kwargs.get("output_format") != "v1.1":
kwargs["output_format"] = "v1.1"
warnings.warn(
"Using default output format 'v1.0' is deprecated and will be removed in version 0.1.70. "
"Please use output_format='v1.1' for enhanced memory details. "
"output_format='v1.0' is deprecated therefore setting it to 'v1.1' by default."
"Check out the docs for more information: https://docs.mem0.ai/platform/quickstart#4-1-create-memories",
DeprecationWarning,
stacklevel=2,
)
kwargs["version"] = "v2"
payload = self._prepare_payload(messages, kwargs)
response = self.client.post("/v1/memories/", json=payload)
response.raise_for_status()