Handle null action in AutoGPT Agent (#3274)

Handle the case where the command is `null`
fix_agent_callbacks
Zander Chase 1 year ago committed by GitHub
parent bf78200f55
commit a71a2c0eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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}"}
)

Loading…
Cancel
Save