From 3f8b9063a1941c21956dba6696d8dca2b35f55af Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Tue, 26 Dec 2023 17:53:57 +0400 Subject: [PATCH] Run black formatter --- memgpt/agent.py | 1 - memgpt/connectors/db.py | 1 - memgpt/connectors/storage.py | 3 --- memgpt/memory.py | 1 - tests/test_load_archival.py | 1 - tests/test_storage.py | 5 ++--- 6 files changed, 2 insertions(+), 10 deletions(-) diff --git a/memgpt/agent.py b/memgpt/agent.py index ca50b4c4..fbb5387f 100644 --- a/memgpt/agent.py +++ b/memgpt/agent.py @@ -25,7 +25,6 @@ from .functions.functions import load_all_function_sets def link_functions(function_schemas): - """Link function definitions to list of function schemas""" # need to dynamically link the functions diff --git a/memgpt/connectors/db.py b/memgpt/connectors/db.py index b567f769..926b1541 100644 --- a/memgpt/connectors/db.py +++ b/memgpt/connectors/db.py @@ -34,7 +34,6 @@ from datetime import datetime # Custom UUID type class CommonUUID(TypeDecorator): - impl = CHAR def load_dialect_impl(self, dialect): diff --git a/memgpt/connectors/storage.py b/memgpt/connectors/storage.py index 90a2ac54..f12f4727 100644 --- a/memgpt/connectors/storage.py +++ b/memgpt/connectors/storage.py @@ -43,7 +43,6 @@ DOCUMENT_TABLE_NAME = "memgpt_documents" # original documents (from source) class StorageConnector: def __init__(self, table_type: TableType, agent_config: Optional[AgentConfig] = None): - config = MemGPTConfig.load() self.agent_config = agent_config self.user_id = config.anon_clientid @@ -82,7 +81,6 @@ class StorageConnector: return filter_conditions def generate_table_name(self, agent_config: AgentConfig, table_type: TableType): - if agent_config is not None: # Table names for agent-specific tables if table_type == TableType.ARCHIVAL_MEMORY: @@ -104,7 +102,6 @@ class StorageConnector: @staticmethod def get_storage_connector(table_type: TableType, storage_type: Optional[str] = None, agent_config: Optional[AgentConfig] = None): - # read from config if not provided if storage_type is None: if table_type == TableType.ARCHIVAL_MEMORY or table_type == TableType.PASSAGES: diff --git a/memgpt/memory.py b/memgpt/memory.py index b84a57fe..afd532d0 100644 --- a/memgpt/memory.py +++ b/memgpt/memory.py @@ -292,7 +292,6 @@ class BaseRecallMemory(RecallMemory): """Recall memory based on base functions implemented by storage connectors""" def __init__(self, agent_config, restrict_search_to_summaries=False): - # If true, the pool of messages that can be queried are the automated summaries only # (generated when the conversation window needs to be shortened) self.restrict_search_to_summaries = restrict_search_to_summaries diff --git a/tests/test_load_archival.py b/tests/test_load_archival.py index c45db5af..78a73461 100644 --- a/tests/test_load_archival.py +++ b/tests/test_load_archival.py @@ -14,7 +14,6 @@ from memgpt.config import AgentConfig, MemGPTConfig @pytest.mark.parametrize("metadata_storage_connector", ["sqlite", "postgres"]) @pytest.mark.parametrize("passage_storage_connector", ["chroma", "postgres"]) def test_load_directory(metadata_storage_connector, passage_storage_connector): - # setup config config = MemGPTConfig() if metadata_storage_connector == "postgres": diff --git a/tests/test_storage.py b/tests/test_storage.py index 61c5e3b6..a106eb9e 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -35,7 +35,7 @@ def generate_passages(embed_model): """Generate list of 3 Passage objects""" # embeddings: use openai if env is set, otherwise local passages = [] - for (text, _, _, agent_id, id) in zip(texts, dates, roles, agent_ids, ids): + for text, _, _, agent_id, id in zip(texts, dates, roles, agent_ids, ids): embedding = None if embed_model: embedding = embed_model.get_text_embedding(text) @@ -47,7 +47,7 @@ def generate_passages(embed_model): def generate_messages(): """Generate list of 3 Message objects""" messages = [] - for (text, date, role, agent_id, id) in zip(texts, dates, roles, agent_ids, ids): + for text, date, role, agent_id, id in zip(texts, dates, roles, agent_ids, ids): messages.append(Message(user_id=user_id, text=text, agent_id=agent_id, role=role, created_at=date, id=id, model="gpt4")) print(messages[-1].text) return messages @@ -56,7 +56,6 @@ def generate_messages(): @pytest.mark.parametrize("storage_connector", ["postgres", "chroma", "sqlite"]) @pytest.mark.parametrize("table_type", [TableType.RECALL_MEMORY, TableType.ARCHIVAL_MEMORY]) def test_storage(storage_connector, table_type): - # setup memgpt config # TODO: set env for different config path config = MemGPTConfig()