Skip to content

Commit

Permalink
Avoid throwing error for older ~/.memgpt/config files due to missin…
Browse files Browse the repository at this point in the history
…g section `archival_storage` (#344)

* avoid error if has old config type
  • Loading branch information
sarahwooders authored Nov 7, 2023
1 parent 4d1cb31 commit fd045ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions memgpt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ def load(cls) -> "MemGPTConfig":
embedding_chunk_size = config.getint("embedding", "chunk_size")

# archival storage
archival_storage_type = config.get("archival_storage", "type")
archival_storage_path = config.get("archival_storage", "path") if config.has_option("archival_storage", "path") else None
archival_storage_uri = config.get("archival_storage", "uri") if config.has_option("archival_storage", "uri") else None
archival_storage_type, archival_storage_path, archival_storage_uri = "local", None, None
if "archival_storage" in config:
archival_storage_type = config.get("archival_storage", "type")
archival_storage_path = config.get("archival_storage", "path") if config.has_option("archival_storage", "path") else None
archival_storage_uri = config.get("archival_storage", "uri") if config.has_option("archival_storage", "uri") else None

anon_clientid = config.get("client", "anon_clientid")

Expand Down

0 comments on commit fd045ba

Please sign in to comment.