From cc039e0c5518aef1896a67b8beb220e69ffac637 Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Mon, 26 Aug 2024 14:40:24 -0700 Subject: [PATCH] fix: add import to function sets --- memgpt/functions/function_sets/base.py | 2 +- memgpt/functions/function_sets/extras.py | 2 +- memgpt/server/rest_api/utils.py | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/memgpt/functions/function_sets/base.py b/memgpt/functions/function_sets/base.py index 39c43a92..c44da324 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 007f346b..aa083ec3 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 79bfcb16..dc448a17 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: "