Remove session_id deprecation warning (#1994)

This commit is contained in:
Dev Khant
2024-10-30 15:32:40 +05:30
committed by GitHub
parent 4896d5c66f
commit efd45c0c4d
3 changed files with 1 additions and 32 deletions

View File

@@ -203,11 +203,6 @@ curl -X POST "https://api.mem0.ai/v1/memories/" \
</CodeGroup>
<Note>
Please use `run_id` instead of `session_id`. The `session_id` parameter is deprecated and will be removed in version 0.1.20.
</Note>
#### Long-term memory for agents
Add a memory layer for the assistants and agents so that their responses remain consistent across sessions.

View File

@@ -1,6 +1,5 @@
import logging
import os
import warnings
from functools import wraps
from typing import Any, Dict, List, Optional, Union
@@ -10,11 +9,6 @@ from mem0.memory.setup import get_user_id, setup_config
from mem0.memory.telemetry import capture_client_event
logger = logging.getLogger(__name__)
warnings.filterwarnings(
"always",
category=DeprecationWarning,
message="The 'session_id' parameter is deprecated. User 'run_id' instead.",
)
# Setup user config
setup_config()
@@ -332,16 +326,6 @@ class MemoryClient:
elif isinstance(messages, list):
payload["messages"] = messages
# Handle session_id deprecation
if "session_id" in kwargs:
warnings.warn(
"The 'session_id' parameter is deprecated and will be removed in version 0.1.20. "
"Use 'run_id' instead.",
DeprecationWarning,
stacklevel=2,
)
kwargs["run_id"] = kwargs.pop("session_id")
payload.update({k: v for k, v in kwargs.items() if v is not None})
return payload
@@ -355,16 +339,6 @@ class MemoryClient:
A dictionary containing the prepared parameters.
"""
# Handle session_id deprecation
if "session_id" in kwargs:
warnings.warn(
"The 'session_id' parameter is deprecated and will be removed in version 0.1.20. "
"Use 'run_id' instead.",
DeprecationWarning,
stacklevel=2,
)
kwargs["run_id"] = kwargs.pop("session_id")
return {k: v for k, v in kwargs.items() if v is not None}

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "mem0ai"
version = "0.1.25"
version = "0.1.26"
description = "Long-term memory for AI Agents"
authors = ["Mem0 <founders@mem0.ai>"]
exclude = [