1
0

[kimi] Break up _dispatch_via_gitea() into helper functions (#1136) (#1183)

This commit is contained in:
2026-03-23 21:40:17 +00:00
parent 74bf0606a9
commit 7aa48b4e22
26 changed files with 195 additions and 115 deletions

View File

@@ -48,21 +48,67 @@ class ModelTier(StrEnum):
# T1: single-action navigation and binary-choice words
_T1_KEYWORDS = frozenset(
{
"go", "move", "walk", "run", "north", "south", "east", "west",
"up", "down", "left", "right", "yes", "no", "ok", "okay",
"open", "close", "take", "drop", "look", "pick", "use",
"wait", "rest", "save", "attack", "flee", "jump", "crouch",
"go",
"move",
"walk",
"run",
"north",
"south",
"east",
"west",
"up",
"down",
"left",
"right",
"yes",
"no",
"ok",
"okay",
"open",
"close",
"take",
"drop",
"look",
"pick",
"use",
"wait",
"rest",
"save",
"attack",
"flee",
"jump",
"crouch",
}
)
# T3: planning, optimisation, or recovery signals
_T3_KEYWORDS = frozenset(
{
"plan", "strategy", "optimize", "optimise", "quest", "stuck",
"recover", "multi-step", "long-term", "negotiate", "persuade",
"faction", "reputation", "best", "optimal", "recommend",
"analyze", "analyse", "evaluate", "decide", "complex", "how do i",
"what should i do", "help me figure", "what is the best",
"plan",
"strategy",
"optimize",
"optimise",
"quest",
"stuck",
"recover",
"multi-step",
"long-term",
"negotiate",
"persuade",
"faction",
"reputation",
"best",
"optimal",
"recommend",
"analyze",
"analyse",
"evaluate",
"decide",
"complex",
"how do i",
"what should i do",
"help me figure",
"what is the best",
}
)
@@ -164,9 +210,7 @@ def build_prompt(
active_quests = state.get("active_quests", [])
if active_quests:
names = [
q if isinstance(q, str) else q.get("name", str(q)) for q in active_quests[:5]
]
names = [q if isinstance(q, str) else q.get("name", str(q)) for q in active_quests[:5]]
context_lines.append(f"Active quests: {', '.join(names)}")
if state.get("stuck"):
@@ -187,8 +231,7 @@ def build_prompt(
system_content = (
"You are Timmy, an AI game agent. "
"Respond with valid game commands only.\n\n"
+ "\n".join(context_lines)
"Respond with valid game commands only.\n\n" + "\n".join(context_lines)
)
return [