aboutsummaryrefslogtreecommitdiff
path: root/llm.py
diff options
context:
space:
mode:
Diffstat (limited to 'llm.py')
-rwxr-xr-xllm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/llm.py b/llm.py
index db72ba3..7577f9f 100755
--- a/llm.py
+++ b/llm.py
@@ -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 (