declare category as category in prompt for skill selection
This commit is contained in:
1 parent
567c280ee2
commit
857ad1ac39
2 files changed
+5
-5
No files matched your search
@@ -219,7 +219,7 @@ the request, the tree, the elicitation answers, the runtime **bridge catalog**
|
|||||||
| `interrupt:choice` | `scheduler.py:279` | request text + `[current process: <skill>]` | `interrupt` / `defer` |
|
| `interrupt:choice` | `scheduler.py:279` | request text + `[current process: <skill>]` | `interrupt` / `defer` |
|
||||||
| `priority:score` | `scheduler.py:296` | request text (+ `[current process: …]` when busy) | critical / high / medium / low |
|
| `priority:score` | `scheduler.py:296` | request text (+ `[current process: …]` when busy) | critical / high / medium / low |
|
||||||
| `navigate:category` | `skills.py:682` | request text | every category name (+ `create_category`) |
|
| `navigate:category` | `skills.py:682` | request text | every category name (+ `create_category`) |
|
||||||
| `navigate:leaf` | `skills.py:736` | request text + `[current process: <category>]` | every skill name + description (+ `create_skill`) |
|
| `navigate:leaf` | `skills.py:736` | request text + current category | every skill name + description (+ `create_skill`) |
|
||||||
| `navigate:response` | `skills.py:634` | request text + category | canned reply names + descriptions (catchall last) |
|
| `navigate:response` | `skills.py:634` | request text + category | canned reply names + descriptions (catchall last) |
|
||||||
| `navigate:intent` | `skills.py:811` | `Requested action: <text>` + `Action of the existing skill: <description>` | `same` / `different` |
|
| `navigate:intent` | `skills.py:811` | `Requested action: <text>` + `Action of the existing skill: <description>` | `same` / `different` |
|
||||||
| `assess:outcome` | `skill.py:257` | skill label + goal + action log | `success` / `failure` |
|
| `assess:outcome` | `skill.py:257` | skill label + goal + action log | `success` / `failure` |
|
||||||
|
|||||||
@@ -465,10 +465,10 @@ def unresolved_variables(
|
|||||||
return [name for name in (skill.contract or {}) if name not in merged]
|
return [name for name in (skill.contract or {}) if name not in merged]
|
||||||
|
|
||||||
|
|
||||||
def compose_state(request: Request, current: str | None = None) -> str:
|
def compose_state(request: Request, additional_context: str | None = None) -> str:
|
||||||
parts = [request.text]
|
parts = [request.text]
|
||||||
if current:
|
if current:
|
||||||
parts.append(f"[current process: {current}]")
|
parts.append(f"({additional_context})")
|
||||||
return " ".join(parts)
|
return " ".join(parts)
|
||||||
|
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ def _navigate_canned(
|
|||||||
if len(ordered) == 1:
|
if len(ordered) == 1:
|
||||||
return ordered[0]
|
return ordered[0]
|
||||||
leaf = DecisionRequest(
|
leaf = DecisionRequest(
|
||||||
state=compose_state(request, current=category),
|
state=compose_state(request, additional_context: f"all choices are within the {category} category"),
|
||||||
question=(
|
question=(
|
||||||
"Which canned response best fits this input? "
|
"Which canned response best fits this input? "
|
||||||
f"Choose {ordered[-1].name} if none of the others does."
|
f"Choose {ordered[-1].name} if none of the others does."
|
||||||
@@ -731,7 +731,7 @@ def navigate(
|
|||||||
"No existing skill performs this action; create a new skill for it.",
|
"No existing skill performs this action; create a new skill for it.",
|
||||||
)
|
)
|
||||||
leaf = DecisionRequest(
|
leaf = DecisionRequest(
|
||||||
state=compose_state(request, current=category),
|
state=compose_state(request),
|
||||||
question=f"Which {category} skill performs the action this request asks for? "
|
question=f"Which {category} skill performs the action this request asks for? "
|
||||||
"Choose create_skill if none does.",
|
"Choose create_skill if none does.",
|
||||||
options=[Option(s.name, s.description) for s in skills] + [create_skill],
|
options=[Option(s.name, s.description) for s in skills] + [create_skill],
|
||||||
|
|||||||
Reference in new issue
Block a user