Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

chore: add deprecation message to legacy client (#1175)

cthomas222b3467219a
diff --git a/letta/client/client.py b/letta/client/client.py
index 58f680c92..e26ffa0a9 100644
--- a/letta/client/client.py
+++ b/letta/client/client.py
@@ -1,4 +1,5 @@
import logging
+import sys
import time
from typing import Callable, Dict, Generator, List, Optional, Union
@@ -40,6 +41,16 @@ from letta.schemas.tool_rule import BaseToolRule
from letta.server.rest_api.interface import QueuingInterface
from letta.utils import get_human_text, get_persona_text
+# Print deprecation notice in yellow when module is imported
+print(
+ "\n\n\033[93m"
+ + "DEPRECATION WARNING: This legacy Python client has been deprecated and will be removed in a future release.\n"
+ + "Please migrate to the new official python SDK by running: pip install letta-client\n"
+ + "For further documentation, visit: https://docs.letta.com/api-reference/overview#python-sdk"
+ + "\033[0m\n\n",
+ file=sys.stderr,
+)
+
def create_client(base_url: Optional[str] = None, token: Optional[str] = None):
if base_url is None: