mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
bug fix and proper log
This commit is contained in:
parent
d5d7db0bf8
commit
2c1538f350
1 changed files with 4 additions and 4 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue