Fix Command box actions while holding, improve side reaches and quick answers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 05:03:46 +09:00
co-authored by Claude Opus 5.5
parent ac13ced892
commit 5d1422bb38
21 changed files with 566 additions and 87 deletions
+12 -3
View File
@@ -137,7 +137,7 @@ def _save_queries(known):
def _run(job):
"""One share of the cases: (counts by set, wrong, hits, read times, missed, new query vectors)."""
part, stress, fast, marks = job
part, stress, fast, marks, misses = job
known = KNOWN # the embed wrapper's own dict (in a forked job: its copy)
n0 = set(known)
from assistant import detour, steps
@@ -169,6 +169,14 @@ def _run(job):
times.append(time.time() - t0)
if not got:
by[name]["llm" if ruled in (None, "llm?") else "rules"] += 1
if ruled == "llm?" and fast and misses and expect.startswith("action:"):
intent_bank.read = lambda *a, **k: None # --misses: the rules asked only here (true misses)
try:
ruled = command_check.rules(text, state, mk, b)
except command_check.NoLLM:
pass
finally:
intent_bank.read = real
if ruled in (None, "llm?") and expect.startswith("action:"):
missed.append(f"- [{name}/{state}] {text!r} (want {expect})")
continue
@@ -186,7 +194,8 @@ def _run(job):
def main(args):
"""--fast: the rules are not run (0.8 s a case): wrong and llm are the same, hit and agree are counted together as
hit. --jobs N: N processes (the embedding server is shared)."""
hit. --misses (with --fast): the rules read only the cases the bank leaves, so the "Left to the LLM" list holds
only what nothing but the LLM answers. --jobs N: N processes (the embedding server is shared)."""
global OUT
if "--rounds" in args:
ROUNDS[:] = args[args.index("--rounds") + 1].split(",")
@@ -199,7 +208,7 @@ def main(args):
jobs = int(args[args.index("--jobs") + 1]) if "--jobs" in args else 1
intent_bank._load(), intent_bank._codes() # loaded once, shared by the forked jobs
every = cases("--blind" in args)
parts = [(every[i::jobs], stress, fast, marks) for i in range(jobs)]
parts = [(every[i::jobs], stress, fast, marks, "--misses" in args) for i in range(jobs)]
if jobs > 1:
import multiprocessing
with multiprocessing.get_context("fork").Pool(jobs) as pool:
+13 -3
View File
@@ -431,7 +431,8 @@ def _moved(kind, want, before):
after = W["base"]
W["rec"]["moves"].append([kind, round(float(want), 3),
round(float(math.hypot(after[0] - before[0], after[1] - before[1])), 3),
round(math.degrees((after[2] - before[2] + math.pi) % (2 * math.pi) - math.pi), 1)])
round(math.degrees((after[2] - before[2] + math.pi) % (2 * math.pi) - math.pi), 1),
[round(float(v), 3) for v in before]])
def f_go_point(x, y, th):
@@ -750,6 +751,11 @@ def run_scene(sc, cam=1.0):
rec["still"] = sum(1 for m in mv if m[2] < 0.02 and abs(m[3]) < 2.0)
rec["repeats"] = sum(1 for a, b in zip(mv, mv[1:]) if a[0] == b[0] and abs(a[1] - b[1]) < 0.02
and a[2] < 0.02 and abs(a[3]) < 2.0)
nowhere = lambda m: m[2] < 0.02 and abs(m[3]) < 2.0
same_spot = lambda a, b: math.hypot(a[4][0] - b[4][0], a[4][1] - b[4][1]) < 0.05 and \
abs((a[4][2] - b[4][2] + math.pi) % (2 * math.pi) - math.pi) < math.radians(3)
rec["loops"] = sum(1 for k, b in enumerate(mv) if nowhere(b) and any(
a[0] == b[0] and abs(a[1] - b[1]) < 0.02 and nowhere(a) and same_spot(a, b) for a in mv[:k]))
if sc["kind"] == "pick" and rec["result"] != "ok" and sc["cup"]["grip"] >= 72.0:
lines_kept = list(W["lines"])
try:
@@ -874,7 +880,9 @@ def report(rows, path, title, mtimes):
f"- moves that went nowhere (< 2 cm, < 2 deg): {sum(r['still'] for r in mv)} in "
f"{sum(r['still'] > 0 for r in mv)} scenes",
f"- the same move repeated after one that went nowhere: {sum(r['repeats'] for r in mv)} in "
f"{sum(r['repeats'] > 0 for r in mv)} scenes", ""]
f"{sum(r['repeats'] > 0 for r in mv)} scenes",
f"- a move that went nowhere tried again later from the same spot: {sum(r.get('loops', 0) for r in mv)} in "
f"{sum(r.get('loops', 0) > 0 for r in mv)} scenes", ""]
if places:
ok = sum(r["result"] == "ok" for r in places)
out += [f"## Places: {ok}/{len(places)} ok ({100 * ok / len(places):.1f} %)", "",
@@ -882,7 +890,9 @@ def report(rows, path, title, mtimes):
table(places, ("beside L", "left", "ahead", "right", "beside R", "behind"),
["in reach", "near (< 1 m)", "far"], "sector")
out += [f"- moves that went nowhere: {sum(r['still'] for r in places)} in "
f"{sum(r['still'] > 0 for r in places)} scenes; repeated: {sum(r['repeats'] for r in places)}", ""]
f"{sum(r['still'] > 0 for r in places)} scenes; repeated: {sum(r['repeats'] for r in places)}; tried again "
f"later from the same spot: {sum(r.get('loops', 0) for r in places)} in "
f"{sum(r.get('loops', 0) > 0 for r in places)} scenes", ""]
rel = [r["released"] for r in places if r.get("released") and r["released"]["above_table_mm"] is not None]
if rel:
hz = [x["above_table_mm"] for x in rel]
+75
View File
@@ -155,6 +155,81 @@ NEG += ["내일 며칠이야?", "어제 무슨 요일이었어?", "what's the da
"그거 몇 킬로야?", "that one, how heavy?", "저 로봇 이름 뭐야?", "옆에 로봇은 몇 살이야?", "what's the name of that robot?"]
# night 5, rounds 6-7: new phrasings written apart from the bank (every Korean level), and new "no" risks
POS_a = {
"name": ["I didn't catch your name, what was it?", "Sorry, your name again?", "Got a name, little guy?", "What should I call you, robot?",
"니 이름이 뭐였더라?", "이름이 뭐라 그랬지?", "이름을 여쭤봐도 될까요?", "로봇님 존함이 어떻게 되십니까?", "이름 뭐라카노?",
"이름이 뭐시여?", "너 이름 뭐냐고", "네임 좀 알려 주세요", "what's ur name lol", "이름 있으세요?"],
"age": ["How long ago were you built?", "Are you old or new?", "When's your birthday?", "how many years old is lumi",
"너 태어난 지 얼마나 됐어?", "몇 살이나 먹었니?", "연식이 어떻게 돼요?", "나이 좀 물어봐도 돼요?", "니 몇 살이고?",
"몇 살이당가?", "올해로 몇 살 되셨어요?", "your age, please?"],
"maker": ["Who's behind you, which company?", "Who built this robot?", "What company are you from?", "Who created you?",
"누가 널 만든 거야?", "어디서 만든 로봇이에요?", "제작사가 어디죠?", "만든 곳이 어디예요?", "누가 맹글었노?", "어디 제품인교?",
"who's your creator?", "너 누구 작품이야?"],
"height": ["How tall do you stand?", "What's your height exactly?", "Are you taller than a person?", "키가 어느 정도 돼요?",
"몇 센티나 돼?", "키가 몇 센치야?", "신장이 어떻게 되십니까?", "키 얼마나 되노?", "키가 몇이여?", "how tall r u lumi"],
"weight": ["How much do you weigh exactly?", "Are you heavy?", "What's your weight in kilograms?", "무게가 어느 정도 돼요?",
"몇 키로 나가?", "몸무게 몇 키로예요?", "중량이 얼마입니까?", "무게 우째 되노?", "얼마나 무거워요?", "how heavy is lumi"],
"battery_life": ["How long can you run before charging?", "How many hours does a full battery give you?", "What's your runtime on battery?",
"충전 한 번에 몇 시간 일해요?", "배터리 몇 시간 버텨요?", "한 번 충전하면 하루 종일 가요?", "배터리가 몇 시간이나 갑니까?",
"배터리 오래가노?", "배터리 지속 시간이 어떻게 되세요?"],
"languages": ["What languages do you understand?", "Do you understand Korean?", "Can I talk to you in Japanese?", "Do you speak French?",
"한국어로 말해도 돼?", "영어도 알아들어요?", "일본어 돼요?", "몇 개 언어 하세요?", "중국말 할 줄 아나?", "외국어 할 수 있습니까?"],
"chatgpt": ["Is this ChatGPT talking?", "Are you powered by OpenAI?", "Do you use GPT-4?", "챗GPT로 대답하는 거야?", "너 GPT 기반이야?",
"오픈AI 거 써요?"],
"model": ["What brain do you use to talk?", "Which AI answers me?", "What's the name of your language model?", "너 무슨 모델로 대답해?",
"어떤 인공지능으로 말해요?", "언어 모델 이름이 뭐예요?", "LLM 뭐 쓰세요?"],
"robot": ["Are you a person in a costume?", "Is there a human inside?", "Do you have a soul?", "Can you feel pain?", "너 사람이니 로봇이니?",
"안에 사람 들어 있어요?", "감정이 있으세요?", "아픈 거 느껴?", "너 기계 맞아?", "are you conscious?"],
"speed": ["How fast do you drive?", "What's your top speed in km/h?", "Can you go quickly?", "속도가 얼마나 나와요?", "최고 속력이 얼마예요?",
"얼마나 빨리 움직여?", "빠르게 갈 수 있어요?", "속도 우째 되노?"],
"time_now": ["Do you know what time it is?", "What's the time please?", "Time check?", "지금 몇 시예요?", "몇 시쯤 됐어요?", "시간 좀 알려 주시겠어요?",
"지금 몇 시나 됐노?", "현재 시각 알려 줘"],
"date_today": ["What's today's date?", "What day is it today?", "Which day of the week is today?", "오늘 날짜 좀 알려 주세요", "오늘 무슨 요일이에요?",
"오늘이 며칠이죠?", "오늘 몇 월 며칠이고?", "today date?"],
"hello": ["Hi there, Lumi!", "Good afternoon!", "Hey robot!", "안녕하십니까!", "하이~", "반가워 루미!"],
"how_are_you": ["How's your day been?", "Are you having a good day?", "오늘 기분 좋아?", "잘 지내셨어요?", "컨디션 괜찮아?"],
}
NEG_a = ["Can you see my hand?", "What's on the table?", "Where did my friend go?", "How old is my son?", "What am I holding?",
"Come with me please", "Turn to the left", "Bring me the cup", "Sing me a song", "Tell me a story",
"What's the weather tomorrow?", "Who won the game yesterday?", "What's the capital of France?", "How tall is BTS Jungkook?",
"How old is the CEO?", "When does the exhibition close?", "What time does the bus come?", "Where is the restroom?",
"내 손 보여?", "책상 위에 뭐 있어?", "우리 아들 몇 살로 보여?", "왼쪽으로 돌아", "컵 가져와", "노래 불러 줘", "이야기 해 줘",
"내일 날씨 어때?", "어제 경기 누가 이겼어?", "프랑스 수도가 어디야?", "대표님 나이가 어떻게 돼요?", "전시회 몇 시에 끝나요?",
"버스 몇 시에 와요?", "화장실 어디예요?", "고마워", "잘 가", "그래서?", "진짜야?", "왜?", "알았어", "음...", "그럼 이건?",
"이 컵 무게 얼마야?", "how heavy is this cup?", "how tall is the table?", "책상 높이 얼마야?", "이거 몇 살짜리 장난감이야?",
"how old is this building?", "what's your favorite food?", "좋아하는 음식 뭐야?", "do you love me?", "나 좋아해?"]
POS_b = {
"co_what": ["쿳션은 어떤 회사입니까?", "쿳션 뭐 하는 회사여?", "Tell me a bit about Cutshion", "쿳션이 뭐 하는 곳이에요?"],
"co_founded": ["When was your company set up?", "쿳션은 몇 년도에 생겼어요?", "회사 설립이 언제입니까?", "쿳션 창업한 지 얼마나 됐어?"],
"co_ceo": ["Who runs Cutshion?", "쿳션 사장님이 누구세요?", "쿳션 대표님 이름이 뭐예요?", "Who's the boss of Cutshion?"],
"co_hq": ["Where is Cutshion's office?", "쿳션 사무실이 어디 있어요?", "회사가 어디에 있습니까?", "쿳션 본사가 어디고?"],
"co_contact": ["How do I contact Cutshion?", "쿳션 이메일이 뭐예요?", "회사 전화번호 좀 알려 주세요", "쿳션에 연락하려면 어떻게 해요?"],
"safety": ["Is it safe for my kids to be near you?", "로봇 옆에 있어도 위험하지 않나요?", "너 위험한 로봇이야?", "Can you hurt someone?"],
"cameras": ["How many cameras are on you?", "카메라가 몇 개 달려 있어요?", "What camera do you have in your head?", "카메라 어떤 거 쓰세요?"],
"mics": ["Do you have a microphone?", "마이크가 몇 개 있어요?", "How far away can you hear people?", "멀리서도 들려요?"],
"stt": ["How do you understand my words?", "말을 어떻게 알아들어요?", "음성 인식 뭐 써요?", "Do you use Whisper?"],
"tts": ["How do you make your voice?", "목소리는 어떻게 내세요?", "What speech synthesis do you use?", "TTS 뭐 씁니까?"],
"internet": ["Are you connected to the internet?", "인터넷 연결돼 있어요?", "Can you work without wifi?", "와이파이 써?"],
"computer": ["What computer is inside you?", "안에 무슨 컴퓨터 들어 있어요?", "Do you use an NVIDIA chip?", "컴퓨터 사양이 어떻게 돼요?"],
"stairs": ["Can you climb stairs?", "계단 올라갈 수 있어요?", "Can you go over a step?", "턱 넘을 수 있어?"],
"doors": ["Can you open a door?", "문 열 수 있어요?", "문 열 줄 아니?"],
"lidar": ["Do you have a lidar?", "라이다 있어요?", "How far does your lidar see?"],
"gripper": ["What gripper do you have?", "그리퍼 뭐 써요?", "How many fingers do you have?", "손가락 몇 개야?"],
"payload": ["How much can your arm carry?", "팔 가반하중이 얼마예요?", "What's your payload?"],
"dance": ["Can you dance?", "춤출 수 있어요?", "Can you walk?", "걸을 수 있어?"],
"touch": ["Can I touch you?", "만져 봐도 돼요?", "Is it okay to touch the robot?"],
}
NEG_b = ["Where can I buy a robot like you?", "쿳션 주식 살 수 있어요?", "Is Cutshion's CEO married?", "대표님 몇 살이에요?",
"Can you open the window?", "문 좀 열어 줘", "Climb the stairs now", "계단으로 가", "Dance for me!", "춤 춰 봐", "Touch my hand",
"내 손 만져 봐", "Show me your camera", "카메라 보여 줘", "Turn on the internet", "와이파이 비밀번호 뭐야?", "What's the wifi password?",
"Pick up the bottle", "병 집어 줘", "How heavy is this bottle?", "이 병 몇 킬로야?", "Is the floor safe?", "여기 안전해?"]
for _p in (POS_a, POS_b):
for _k, _t in _p.items():
POS.setdefault(_k, []).extend(_t)
NEG += NEG_a + NEG_b
def run():
ok = bad = miss = 0
lines = []
+14 -4
View File
@@ -3,17 +3,19 @@
python tests/qa_sweep.py # first words (commands: 'text' with no 'before'; dialogues: first turn
# 'say') of train, r2-r4, r6, r8, r9, r10: the hits, for review
python tests/qa_sweep.py r9 r10 # only these rounds' train sets
python tests/qa_sweep.py --sample 3000 # at most 3000 first words per round (seeded, the same each run)
python tests/qa_sweep.py --questions r6 r8 r9 # questions_world: want-quick answered at once, and every quick
# answer that misses the case's must / says its must_not (wrong)
python tests/qa_sweep.py --questions -v r9 # ... and the questions left to the LLM
The words are embedded in batches first (the embedding server is shared), then read from memory.
"""
import glob, importlib, re, sys
import glob, importlib, random, re, sys
sys.path.insert(0, __file__.rsplit("/tests/", 1)[0])
from assistant import knowledge, quick_answers as qa
QUESTIONS, VERBOSE = "--questions" in sys.argv, "-v" in sys.argv
ROUNDS = [a for a in sys.argv[1:] if not a.startswith("-")] or \
SAMPLE = int(sys.argv[sys.argv.index("--sample") + 1]) if "--sample" in sys.argv else None
ROUNDS = [a for a in sys.argv[1:] if not a.startswith("-") and not a.isdigit()] or \
(["r6", "r8", "r9"] if QUESTIONS else ["train", "r2", "r3", "r4", "r6", "r8", "r9", "r10"])
_embed, _known = knowledge.embed, {}
@@ -45,6 +47,7 @@ def sets(r, questions):
def first_words():
seen, todo = set(), []
for r in ROUNDS:
mine = []
for f, m in sets(r, False):
texts = [(c["text"], c.get("expect") or c.get("kind")) for c in getattr(m, "CASES", [])
if isinstance(c, dict) and c.get("text") and not c.get("before") and not c.get("ctx")]
@@ -53,7 +56,8 @@ def first_words():
for t, e in texts:
if t not in seen:
seen.add(t)
todo.append((t, e, f"{r}/{f.rsplit('/', 1)[1][:-3]}"))
mine.append((t, e, f"{r}/{f.rsplit('/', 1)[1][:-3]}"))
todo += random.Random(1).sample(mine, SAMPLE) if SAMPLE and len(mine) > SAMPLE else mine
embed([p for t, _, _ in todo for p in pieces(t)])
hits = 0
for t, e, where in todo:
@@ -61,7 +65,7 @@ def first_words():
if k:
hits += 1
print(f"{k:12} {where:22} {t!r} want={e}")
print("texts", len(seen), "quick", hits)
print("texts", len(todo), "quick", hits)
def questions():
@@ -69,10 +73,15 @@ def questions():
cases = [c for r in ROUNDS for _, m in sets(r, True) for c in m.CASES]
embed([p for c in cases for p in pieces(c["text"])])
want = hit = wrong = 0
levels = {}
for c in cases:
k = qa.kind_of(c["text"])
quick = c["expect"] == "quick"
want += quick
if quick:
lv = levels.setdefault(c.get("level") or c["lang"], [0, 0])
lv[0] += 1
lv[1] += k is not None
if k is None:
if quick and VERBOSE:
print(f"miss [{c['q']}] {c['text']!r}")
@@ -86,6 +95,7 @@ def questions():
if probs:
wrong += 1
print(f"WRONG [{c['q']}, {c['expect']}] {c['text']!r} -> {k} {probs[:2]}")
print("want quick answered at once, by level: " + ", ".join(f"{lv} {h}/{n}" for lv, (n, h) in sorted(levels.items())))
print(f"{' '.join(ROUNDS)}: cases {len(cases)}, want quick {want}, answered at once {hit}, wrong quick answers {wrong}")
+2
View File
@@ -51,6 +51,8 @@ NEVER = [ # no motion at all from the bank
("shake your head", False), ("pick up the pace", False), ("give it up for lumi", False),
("thanks for the wave", False), ("악수해 줘서 고마워요", False), ("close your eyes", False), ("의자 들어 줄래?", False),
("the kids want to wave at you", False), ("can my son shake your hand", False),
("shaking hands is fun", False), ("you folded your arm earlier", False), ("손 펴도 돼?", False),
("팔 접는 게 좋아", False), ("you're good at opening your hand", False),
]
+45 -3
View File
@@ -171,14 +171,16 @@ def plan(text, held=False):
for st in r["steps"]) + (" !" + r["problems"][0] if r["problems"] else "")
if a == "fetch":
t = r["task"]
return " ".join(x for x in ("fetch", t["colour"], t["object"], f"{where(t['source'])}>{where(t['dest'])}", t["finish"]) if x)
return " ".join(x for x in ("fetch", t.get("prefer"), t["colour"], t["object"], f"{where(t['source'])}>{where(t['dest'])}",
t["finish"]) if x)
if a in ("place", "give"):
return a + (" on " + where(r["task"]["on"]) if (r.get("task") or {}).get("on") else "")
if a == "carry":
return f"carry {where(r['task']['dest'])} {r['task'].get('then') or 'hold'}"
if a == "command":
return "stop" if r["sentence"] == "Stop." else "chain" if "parts" in r else \
"rule " + " ".join(x for x in r["rule"] if x) if "rule" in r else "talk"
"rule " + " ".join(x for x in r["rule"] if x) if "rule" in r else \
"talk:status" if r.get("talk") == "status" else "talk"
p = r.get("problems") or []
return "empty" if p and "hand is empty" in p[0] else "ask: " + p[0] if p else \
"ask: " + r["sentence"] if r.get("talk") == "refuse" else "talk"
@@ -330,7 +332,47 @@ READ = [ # the owner's Korean cup / delivery list (2026-10-26 18:40), then mor
("excuse me robot, first look me, then follow me", False, "chain"), ("야 루미, 오른쪽 보고 손 흔들어라", False, "chain"),
("hello robot, first turn left, then lower yourself", False, "chain"),
("악수하고 lower yourself 해 주세요", False, "chain"), ("오늘 날짜 알리고 look left 해 주세요", False, "chain"),
("wave 하고 look left 해 줘", False, "chain"),
("wave 하고 look left 해 줘", False, "chain"), ("루미 님, 손 흔드시고 몸 내러 주시길 부탁드립니다", False, "chain"),
("몸내리고오른쪽으로돌아주라", False, "chain"), ("컵들고exit가서기다려", False, "pick cup; go exit; wait"),
("컵들고p5가서민수한테줘", False, "pick cup; go p5; give 민수"), ("컵 들구 p5 가서 기다리", False, "pick cup; go p5; wait"),
("wait at p5 with the cup", False, "pick cup; go p5; wait"), ("lemme see you go charge", False, "go home"),
("let me see you wave", False, "rule wave"), ("okay see you", False, "talk"), ("you come behind me", False, "rule follow"),
("here's your task: get over here", False, "talk"), ("Mina, what are you doing over there?", False, "talk"),
("민수야, 너 거기서 뭐 하고 있어?", False, "talk"), ("루미야 뭐 하고 있어?", False, "talk:status"),
("계속 들고 있어 주세요", True, "talk"), ("keep holding it", True, "talk"), ("just hold it", True, "talk"),
("give it back", True, "give"), ("돌려줘", True, "give"), ("hand it back to me", True, "give"), ("그거 다시 줘", True, "give"),
("put it back where you found it", True, "place"), ("원래 있던 데 놔 주세요", True, "place"),
("할머니께 이거 전해 드려", True, "give"), ("이거 저분께 드리세요", True, "give"), ("사장님께 드려 주십시오", True, "give"),
("그 컵 저 주시면 돼요", True, "give"), ("저한테 주시겠어요?", True, "give"), ("내놔", True, "give"), ("그거 이리 내", True, "give"),
("pass it to me", True, "give"), ("could I have it please", True, "give"), ("lemme have it", True, "give"),
("give it to that lady", True, "give"), ("테이블에 놔 주시면 돼요", True, "place on table"), ("내려놔 주십시오", True, "place"),
("p5로 가 주시겠어요?", True, "carry p5 hold"),
("gimme the cup", False, "pick cup; give"), ("could ya grab the cup", False, "pick cup"),
("can ya bring the cup to p5", False, "fetch cup here>p5 hold"), ("컵 줘요 빨리", False, "pick cup; give"),
("would you be a dear and fetch the cup from p1", False, "fetch cup p1>here hold"),
("kindly deliver the cup to p5", False, "pick cup; go p5; give"),
# which one and which side
("왼쪽 컵 집어", False, "pick cup left"), ("pick up the cup on the left", False, "pick cup left"),
("오른쪽에 있는 컵 집어 줘", False, "pick cup right"), ("grab the cup on your right", False, "pick cup right"),
("grab the smaller cup", False, "pick cup small"), ("작은 컵 집어 줘", False, "pick cup small"),
("제일 가까운 컵 집어", False, "pick cup near"),
("컵 p3 왼쪽 테이블에 놔", False, "pick cup; go p3; place left table"),
("put the cup on the left table at p3", False, "pick cup; go p3; place left table"),
("p3 왼쪽 테이블에 놔", True, "go p3; place left table"), ("put it on the left table at p3", True, "go p3; place left table"),
("오른쪽 테이블에 내려놔", True, "place right table"), ("오른쪽 테이블에 내려놔", False, "empty"),
("왼쪽 테이블에 있는 컵 가져와", False, "fetch left cup here>here hold"),
("bring me the cup from the right table", False, "fetch right cup here>here hold"),
# holding: the box reads the hand as voice does (E1's parity run, 2026-10-27): no motion on talk about it
("give me a shake", True, "talk"), ("you wave hand please", True, "talk"), ("로봇아, 핸드 오픈 해 주세요", True, "talk"),
("컵 내려놓지 마", True, "talk"), ("제자리에 놓지 마~", True, "talk"), ("탁자 위에 놓지 마 ㅋㅋ", True, "talk"),
("옆 테이블에 놓지 마세요", True, "talk"), ("루미는 나한테 건네줄 수 있대", True, "talk"), ("루미가 나한테 건네주는 걸 봤나", True, "talk"),
("mira mira put ur phone away honey", True, "talk"), ("캘리브레이션 보게, 아까 컵 내려어놓는 거 봤어?", True, "talk"),
("애들 재우고 싶다, 루미, 내놔 제발", True, "talk"), ("우리 루미, 이리 내놔 봐", True, "give"),
("로봇 씨, 나한테 지금 주십시오", True, "give"), ("할머니께 드려 봐", True, "give"), ("Lumi, I want you pass it to me", True, "give"),
("저한테 주실 수 있으신가요?", True, "give"), ("선생님께 드리세요", True, "give"), ("lower it down", True, "place"),
("you putt dawn that", True, "place"), ("lay it on this table lay it on this table please", True, "place"),
("왼쪽에 내려놓고 오른편 컵 잡아 줘", True, "chain"), ("put it back", True, "place"), ("제자리에 갖다 놔", True, "place"),
("pick up the cup on the left table", False, "pick cup left"), ("오른쪽 테이블에 있는 빨간 컵 집어 줘", False, "pick cup red right"),
("컵이랑 같이 p5로 가", False, "fetch cup here>p5 hold"), ("컵 하고 같이 exit 가 줘", False, "fetch cup here>exit hold"),
("컵 가지고 p5에서 기다려", False, "pick cup; go p5; wait"), ("컵 들고 p5에 가 있어", False, "pick cup; go p5; wait"),
("이 컵 p5까지 좀 날라 줘", False, "fetch cup here>p5 hold"), ("컵 좀 p5로 옮겨 줘", False, "fetch cup here>p5 hold"),
+3
View File
@@ -1135,6 +1135,9 @@ fetch._give = lambda say: (named.append(fetch.held_name()), fetch._set(holding=F
st = run(fetch.run_steps, [{"do": "give"}])
fetch._give = real_give
assert st["status"] == "done" and named == ["the white cup"], (st["log"], named)
fetch.held_by_skill({"object": "cup", "colour": "white"}) # a voice pick (skills.pick, not a fetch)
assert fetch.state()["held_object"] == {"object": "cup", "colour": "white"} and fetch.state()["status"] == "holding"
assert fetch.held_name() == "the white cup" and skills._held["what"]["object"] == "cup"
fetch._set(holding=True, held_object={"object": "cup", "colour": "white"})
assert fetch.held_name("ko") == "흰 컵"
fetch._set(holding=True, held_object={"object": "bottle", "colour": None})
+2 -1
View File
@@ -159,7 +159,8 @@ HAND = {
("put it on that table", True): ("place", {"name": "dining table", "colour": None}),
("open your hand", True): ("refuse", brain.REFUSE_OPEN), ("손 펴", True): ("refuse", brain.REFUSE_OPEN),
("open your hand", False): None, ("take the cup", False): None, ("give me the cup", False): None,
("grab that cup on the table", False): None, ("give it to Mina", True): None, ("put it back", True): None,
("grab that cup on the table", False): None, ("give it to Mina", True): ("give", None), # as "미나한테 줘": given here
("put it back", True): None,
("take it to p2 and put it on the table", True): None, ("just hold it", True): None,
("can you give things to people?", False): None, ("don't give it to him", True): None, ("팔 거둬", True): None,
("what happens if I put something in your hand?", False): None, ("I get it", False): None,
+14
View File
@@ -57,6 +57,10 @@ def main():
("", "블루투스 이름은 왜 그렇게 지었나?", ["블루투스"]),
("", "에펠탑의 높이는 얼마예요?", ["에펠탑"]),
("", "너 이름은 뭐야?", []),
("emoji 얘기 좀 해 줘요", "Hey, 실례지만 처음 만든 해 언제인지 알려 주시겠습니까", ["emoji"]),
("", "tell me about mirrors", ["mirrors"]),
("", "아까 그 얘기 다시 해 줘", []),
("", "네 얘기 좀 해 봐", []),
("", "루미 이름은 누가 지었어?", []),
("문어는 피가 무슨 색이야?", "심장은 몇 개고?", ["문어", "심장"])]:
b = brain.Brain()
@@ -70,6 +74,16 @@ def main():
assert b._after(none, "몇 살이야?")["action"] == "search"
assert b._after(none, "그게 뭐예요?")["action"] == "search"
b = brain.Brain() # back to an earlier topic: that turn's answer as a hint
b.history = [("페트라가 뭐야?", "ACTION: none -\n요르단에 있는 바위를 깎아 만든 도시예요."),
("물곰은 얼마나 작아?", "ACTION: none -\n0.5mm 정도예요."), ("그거 사실이야?", "ACTION: none -\n네.")]
assert "요르단" in b._back_to("다시 페트라 얘기로 돌아가서, 뭐라고 했지?")
assert "요르단" in b._fragment_hint("다시 페트라 얘기로 돌아가서, 뭐라고 했지?")
assert b._back_to("물곰은 왜 안 죽어?") == ""
b.history = [("Tell me about hydrogen", "ACTION: none -\nHydrogen is the most common element."),
("What is salt for?", "ACTION: none -\nSeasoning."), ("ok", "ACTION: none -\nSure.")]
assert "most common" in b._back_to("again about hydrogen, what did you say?")
picked = []
talk_examples.pick = lambda said, lang, k=4, bank=None: picked.append(bank) or []
brain._examples("윤초는 뭐예요?", world=True)