Spaces:
Sleeping
Sleeping
File size: 514 Bytes
d6a76d5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# agent_rule_based.py
def get_action(obs):
#def act(obs):
known = obs.get("known_info", {})
required_full = obs.get("required_info_full", [])
# 1. classify first
if "category" not in known or "priority" not in known:
return {"type": "classify"}
# 2. collect missing info
missing = [f for f in required_full if f not in known]
if len(missing) > 0:
return {"type": "ask_info", "field": missing[0]}
# 3. resolve only when complete
return {"type": "resolve"} |