diff options
Diffstat (limited to 'llm.py')
| -rwxr-xr-x | llm.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -87,10 +87,10 @@ def query_agent(query: str, config: AgentConfig, state=()): try: action = json.loads(json_str) action_name = action["action"] - except (json.JSONDecodeError, KeyError): + except (json.JSONDecodeError, KeyError, TypeError): continue - f = first(config.actions, lambda f: f.name == action_name) + f = first(config.actions, lambda f: f.name == action_name and all(k in action for k in f.required_keys)) if f is not None: desc = f.formatter(action) if ( |
