Remove session_id deprecation warning (#1994)
This commit is contained in:
@@ -203,11 +203,6 @@ curl -X POST "https://api.mem0.ai/v1/memories/" \
|
|||||||
|
|
||||||
</CodeGroup>
|
</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
|
#### Long-term memory for agents
|
||||||
Add a memory layer for the assistants and agents so that their responses remain consistent across sessions.
|
Add a memory layer for the assistants and agents so that their responses remain consistent across sessions.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import warnings
|
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import Any, Dict, List, Optional, Union
|
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
|
from mem0.memory.telemetry import capture_client_event
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
warnings.filterwarnings(
|
|
||||||
"always",
|
|
||||||
category=DeprecationWarning,
|
|
||||||
message="The 'session_id' parameter is deprecated. User 'run_id' instead.",
|
|
||||||
)
|
|
||||||
|
|
||||||
# Setup user config
|
# Setup user config
|
||||||
setup_config()
|
setup_config()
|
||||||
@@ -332,16 +326,6 @@ class MemoryClient:
|
|||||||
elif isinstance(messages, list):
|
elif isinstance(messages, list):
|
||||||
payload["messages"] = messages
|
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})
|
payload.update({k: v for k, v in kwargs.items() if v is not None})
|
||||||
return payload
|
return payload
|
||||||
|
|
||||||
@@ -355,16 +339,6 @@ class MemoryClient:
|
|||||||
A dictionary containing the prepared parameters.
|
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}
|
return {k: v for k, v in kwargs.items() if v is not None}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "mem0ai"
|
name = "mem0ai"
|
||||||
version = "0.1.25"
|
version = "0.1.26"
|
||||||
description = "Long-term memory for AI Agents"
|
description = "Long-term memory for AI Agents"
|
||||||
authors = ["Mem0 <founders@mem0.ai>"]
|
authors = ["Mem0 <founders@mem0.ai>"]
|
||||||
exclude = [
|
exclude = [
|
||||||
|
|||||||
Reference in New Issue
Block a user