Skip to content

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

bug fix and proper log

geekan2c1538f35035
diff --git a/metagpt/schema.py b/metagpt/schema.py
index 7359084f5..b24f114b0 100644
--- a/metagpt/schema.py
+++ b/metagpt/schema.py
@@ -266,11 +266,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):