forked from Archives/langchain
Handle null action in AutoGPT Agent (#3274)
Handle the case where the command is `null`
This commit is contained in:
parent
bf78200f55
commit
a71a2c0eb2
@ -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…
Reference in New Issue
Block a user