Skip to content

Commit

Permalink
Remove session_id deprecation warning (#1994)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-Khant authored Oct 30, 2024
1 parent 4896d5c commit efd45c0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
5 changes: 0 additions & 5 deletions docs/platform/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
26 changes: 0 additions & 26 deletions mem0/client/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import os
import warnings
from functools import wraps
from typing import Any, Dict, List, Optional, Union

Expand All @@ -10,11 +9,6 @@
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()
Expand Down Expand Up @@ -332,16 +326,6 @@ def _prepare_payload(
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

Expand All @@ -355,16 +339,6 @@ def _prepare_params(self, kwargs: Dict[str, Any]) -> Dict[str, Any]:
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}


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
exclude = [
Expand Down

0 comments on commit efd45c0

Please sign in to comment.