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