From efd45c0c4d9753a7aba8db9506f28fd620002d25 Mon Sep 17 00:00:00 2001 From: Dev Khant Date: Wed, 30 Oct 2024 15:32:40 +0530 Subject: [PATCH] Remove session_id deprecation warning (#1994) --- docs/platform/quickstart.mdx | 5 ----- mem0/client/main.py | 26 -------------------------- pyproject.toml | 2 +- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/docs/platform/quickstart.mdx b/docs/platform/quickstart.mdx index 5ad0c558..82b877f8 100644 --- a/docs/platform/quickstart.mdx +++ b/docs/platform/quickstart.mdx @@ -203,11 +203,6 @@ curl -X POST "https://api.mem0.ai/v1/memories/" \ - - Please use `run_id` instead of `session_id`. The `session_id` parameter is deprecated and will be removed in version 0.1.20. - - - #### Long-term memory for agents Add a memory layer for the assistants and agents so that their responses remain consistent across sessions. diff --git a/mem0/client/main.py b/mem0/client/main.py index 1dc1fba5..3996b05a 100644 --- a/mem0/client/main.py +++ b/mem0/client/main.py @@ -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} diff --git a/pyproject.toml b/pyproject.toml index 90256b32..5f9b7c9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] exclude = [