Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

bug fix and proper log

geekan9ca0d57a91be
diff --git a/metagpt/schema.py b/metagpt/schema.py
index c026ea1d9..991ceaae0 100644
--- a/metagpt/schema.py
+++ b/metagpt/schema.py
@@ -282,11 +282,11 @@ T = TypeVar("T", bound="BaseModel")
class BaseContext(BaseModel):
- @staticmethod
+ @classmethod
@handle_exception
- def loads(val: str, cls: Type[T]) -> Optional[T]:
- m = json.loads(val)
- return cls(**m)
+ def loads(cls: Type[T], val: str) -> Optional[T]:
+ i = json.loads(val)
+ return cls(**i)
class CodingContext(BaseContext):