Skip to content

Commit

Permalink
Use deep copy and cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
waynehamadi committed Jun 26, 2023
1 parent a1a77c2 commit 068dcfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 3 additions & 5 deletions autogpt/core/configuration/schema.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import abc
import copy
import typing
from typing import Any

from pydantic import BaseModel, Field


def UserConfigurable(*args, **kwargs):
return Field(*args, **kwargs, user_configurable=True)
from pydantic import BaseModel


class SystemConfiguration(BaseModel):
Expand Down Expand Up @@ -88,6 +85,7 @@ def deep_update(original_dict: dict, update_dict: dict) -> dict:
Returns:
dict: The updated dictionary.
"""
original_dict = copy.deepcopy(original_dict)
for key, value in update_dict.items():
if (
key in original_dict
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def config(

config.plugins_dir = "tests/unit/data/test_plugins"
config.plugins_config_file = temp_plugins_config_file

# avoid circular dependency
from autogpt.plugins.plugins_config import PluginsConfig

config.plugins_config = PluginsConfig.load_config(global_config=config)
Expand Down Expand Up @@ -98,7 +100,6 @@ def agent(config: Config, workspace: Workspace) -> Agent:
command_registry = CommandRegistry()
ai_config.command_registry = command_registry
config.memory_backend = "json_file"
config.memory_backend = "json_file"
memory_json_file = get_memory(config)
memory_json_file.clear()

Expand Down

0 comments on commit 068dcfd

Please sign in to comment.