mirror of
https://github.com/trycua/computer.git
synced 2026-01-05 21:09:58 -06:00
Dummy (small) models can produce action_types=None, which will later produce a crash, avoid it
This commit is contained in:
@@ -411,6 +411,9 @@ class ComputerAgent:
|
||||
# Perform computer actions
|
||||
action = item.get("action")
|
||||
action_type = action.get("type")
|
||||
if action_type is None:
|
||||
print(f"Action type cannot be `None`: action={action}, action_type={action_type}")
|
||||
return []
|
||||
|
||||
# Extract action arguments (all fields except 'type')
|
||||
action_args = {k: v for k, v in action.items() if k != "type"}
|
||||
|
||||
Reference in New Issue
Block a user