mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-20 22:03:52 +00:00
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"],
|
name=parsed["command"]["name"],
|
||||||
args=parsed["command"]["args"],
|
args=parsed["command"]["args"],
|
||||||
)
|
)
|
||||||
except KeyError:
|
except (KeyError, TypeError):
|
||||||
|
# If the command is null or incomplete, return an erroneous tool
|
||||||
return AutoGPTAction(
|
return AutoGPTAction(
|
||||||
name="ERROR", args={"error": f"Incomplete command args: {parsed}"}
|
name="ERROR", args={"error": f"Incomplete command args: {parsed}"}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user