mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-24 14:15:17 +02:00
refactor: Simplify the Message class.
This commit is contained in:
parent
af4c87e123
commit
c18bc7c876
4 changed files with 63 additions and 215 deletions
|
|
@ -325,3 +325,14 @@ def any_to_str(val) -> str:
|
|||
return get_object_name(val)
|
||||
|
||||
return get_class_name(val)
|
||||
|
||||
|
||||
def any_to_str_set(val) -> set:
|
||||
"""Convert any type to string set."""
|
||||
res = set()
|
||||
if isinstance(val, dict) or isinstance(val, list) or isinstance(val, set) or isinstance(val, tuple):
|
||||
for i in val:
|
||||
res.add(any_to_str(i))
|
||||
else:
|
||||
res.add(any_to_str(val))
|
||||
return res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue