1
1
import logging
2
2
import os
3
- import warnings
4
3
from functools import wraps
5
4
from typing import Any , Dict , List , Optional , Union
6
5
10
9
from mem0 .memory .telemetry import capture_client_event
11
10
12
11
logger = logging .getLogger (__name__ )
13
- warnings .filterwarnings (
14
- "always" ,
15
- category = DeprecationWarning ,
16
- message = "The 'session_id' parameter is deprecated. User 'run_id' instead." ,
17
- )
18
12
19
13
# Setup user config
20
14
setup_config ()
@@ -332,16 +326,6 @@ def _prepare_payload(
332
326
elif isinstance (messages , list ):
333
327
payload ["messages" ] = messages
334
328
335
- # Handle session_id deprecation
336
- if "session_id" in kwargs :
337
- warnings .warn (
338
- "The 'session_id' parameter is deprecated and will be removed in version 0.1.20. "
339
- "Use 'run_id' instead." ,
340
- DeprecationWarning ,
341
- stacklevel = 2 ,
342
- )
343
- kwargs ["run_id" ] = kwargs .pop ("session_id" )
344
-
345
329
payload .update ({k : v for k , v in kwargs .items () if v is not None })
346
330
return payload
347
331
@@ -355,16 +339,6 @@ def _prepare_params(self, kwargs: Dict[str, Any]) -> Dict[str, Any]:
355
339
A dictionary containing the prepared parameters.
356
340
"""
357
341
358
- # Handle session_id deprecation
359
- if "session_id" in kwargs :
360
- warnings .warn (
361
- "The 'session_id' parameter is deprecated and will be removed in version 0.1.20. "
362
- "Use 'run_id' instead." ,
363
- DeprecationWarning ,
364
- stacklevel = 2 ,
365
- )
366
- kwargs ["run_id" ] = kwargs .pop ("session_id" )
367
-
368
342
return {k : v for k , v in kwargs .items () if v is not None }
369
343
370
344
0 commit comments