Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Fix Config.plugins_config - call model_post_init explicitly until pydantic 2.0 (#4858)

Luke7e45b6a9758c
diff --git a/autogpt/config/config.py b/autogpt/config/config.py
index a84a859518..bec3e92144 100644
--- a/autogpt/config/config.py
+++ b/autogpt/config/config.py
@@ -83,6 +83,13 @@ class Config(SystemSettings):
plugins: list[str]
authorise_key: str
+ def __init__(self, **kwargs):
+ super().__init__(**kwargs)
+
+ # Hotfix: Call model_post_init explictly as it doesn't seem to be called for pydantic<2.0.0
+ # https://github.com/pydantic/pydantic/issues/1729#issuecomment-1300576214
+ self.model_post_init(**kwargs)
+
# Executed immediately after init by Pydantic
def model_post_init(self, **kwargs) -> None:
if not self.plugins_config.plugins: