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.

fix: add import to function sets

Sarah Wooderscc039e0c5518
diff --git a/memgpt/functions/function_sets/base.py b/memgpt/functions/function_sets/base.py
index 39c43a923..c44da3246 100644
--- a/memgpt/functions/function_sets/base.py
+++ b/memgpt/functions/function_sets/base.py
@@ -1,10 +1,10 @@
import datetime
-import json
import math
from typing import Optional
from memgpt.agent import Agent
from memgpt.constants import MAX_PAUSE_HEARTBEATS, RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
+from memgpt.utils import json_dumps
### Functions / tools the agent can use
# All functions should return a response string (or None)
diff --git a/memgpt/functions/function_sets/extras.py b/memgpt/functions/function_sets/extras.py
index 007f346b5..aa083ec34 100644
--- a/memgpt/functions/function_sets/extras.py
+++ b/memgpt/functions/function_sets/extras.py
@@ -1,4 +1,3 @@
-import json
import os
import uuid
from typing import Optional
@@ -11,6 +10,7 @@ from memgpt.constants import (
)
from memgpt.llm_api.llm_api_tools import create
from memgpt.schemas.message import Message
+from memgpt.utils import json_dumps, json_loads
def message_chatgpt(self, message: str):
diff --git a/memgpt/server/rest_api/utils.py b/memgpt/server/rest_api/utils.py
index 79bfcb167..dc448a174 100644
--- a/memgpt/server/rest_api/utils.py
+++ b/memgpt/server/rest_api/utils.py
@@ -1,14 +1,11 @@
-import json
import traceback
from enum import Enum
from typing import AsyncGenerator, Union
from pydantic import BaseModel
-from memgpt.orm.user import User
-from memgpt.orm.utilities import get_db_session
-from memgpt.server.rest_api.interface import StreamingServerInterface
-from memgpt.server.server import SyncServer
+# from memgpt.orm.user import User
+# from memgpt.orm.utilities import get_db_session
from memgpt.utils import json_dumps
SSE_PREFIX = "data: "