Handle null action in AutoGPT Agent (#3274)

Handle the case where the command is `null`
This commit is contained in:
Zander Chase 2023-04-20 23:18:46 -07:00 committed by GitHub
parent bf78200f55
commit a71a2c0eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,8 @@ class AutoGPTOutputParser(BaseAutoGPTOutputParser):
name=parsed["command"]["name"],
args=parsed["command"]["args"],
)
except KeyError:
except (KeyError, TypeError):
# If the command is null or incomplete, return an erroneous tool
return AutoGPTAction(
name="ERROR", args={"error": f"Incomplete command args: {parsed}"}
)