Commands: chained commands, questions and talk run in the order said; a part that can't run is said with its reason
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ import re
|
||||
import sys
|
||||
import time
|
||||
|
||||
from assistant import brain, driving, lumi, seeing
|
||||
from assistant import brain, chain, driving, lumi, seeing
|
||||
from audio import sing
|
||||
from tests.command_cases import CASES as CASES1
|
||||
from tests.command_cases2 import CASES as CASES2 # 2026-10-21 night: new wordings, the conference map
|
||||
@@ -63,6 +63,10 @@ def rules(text, state, marks, b):
|
||||
return "talk"
|
||||
if lumi.stop_order(text, marks):
|
||||
return "stop"
|
||||
parts = chain.plan(text, marks, lumi.NOT_A_STEP) # lumi.chain_request: every part in the order said
|
||||
if parts:
|
||||
return "chain:" + "+".join(k if k != "quick" else "_".join(filter(None, w)).replace(" ", "_")
|
||||
for k, _, w in parts)
|
||||
if seen(text):
|
||||
return "seeing"
|
||||
if lumi.status_question(text):
|
||||
@@ -82,7 +86,7 @@ def rules(text, state, marks, b):
|
||||
return "talk" if read[1] else "refuse" if steps.check(read[0], holding, marks) else "mission"
|
||||
if lumi.talk_fate(text) == "end":
|
||||
return "end"
|
||||
if lumi.talk_fate(text) == "wait":
|
||||
if lumi.talk_fate(text) == "close": # read by the LLM with the talk before: no command
|
||||
return "talk"
|
||||
if sing.asked(text):
|
||||
return "sing"
|
||||
@@ -138,6 +142,8 @@ def ok(expect, got):
|
||||
want = refused(alt).split() # "pick bottle": the reason why not is right
|
||||
if want[0] in ("talk", "ask") and g[0] in ("talk", "ask", "refuse"): # a reason why not is an answer
|
||||
return "right"
|
||||
if want[0] == "chain" and g[0].startswith("chain:"):
|
||||
return "right" # several parts, each done in turn (lumi.chain_run)
|
||||
if want[0] == "action:fetch" and g[0] == "action:fetch":
|
||||
return "right" # parse_fetch reads the words later
|
||||
if want[0] == g[0] and all(w in g[1:] for w in want[1:]):
|
||||
|
||||
Reference in New Issue
Block a user