mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-28 02:23:52 +02:00
refine code for isinstance
This commit is contained in:
parent
77735d6e61
commit
3baf47a3d6
4 changed files with 4 additions and 4 deletions
|
|
@ -197,7 +197,7 @@ class OutputParser:
|
|||
result = ast.literal_eval(structure_text)
|
||||
|
||||
# Ensure the result matches the specified data type
|
||||
if isinstance(result, list) or isinstance(result, dict):
|
||||
if isinstance(result, (list, dict)):
|
||||
return result
|
||||
|
||||
raise ValueError(f"The extracted structure is not a {data_type}.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue