android-skill-router / src /classifier_prompt.py
kriyanshi's picture
Ship v2 intent extraction with API, demo UI, eval, and benchmark suite.
40a90bb
Raw
History Blame Contribute Delete
1.36 kB
"""Shared system prompts for skill classification and intent extraction."""
from __future__ import annotations
SYSTEM_PROMPT = (
"You classify Android automation requests into exactly one skill. "
'Reply with JSON only: {"skill": "<skill_name>"}. '
"Use the app or action named in the request (contacts, Gmail, Slack, YouTube, etc.) "
"to pick the correct skill."
)
INTENT_SYSTEM_PROMPT = (
"You extract structured Android automation intents from natural language. "
'Reply with JSON only: {"skill": "<skill_name>", "parameters": {<extracted_fields>}}. '
"Pick exactly one skill. Extract all relevant parameters mentioned in the request "
"(contact names, messages, times, destinations, channel names, search queries, etc.). "
"Use an empty object for parameters when the skill needs none. "
"Use the app or action named in the request (contacts, Gmail, Slack, YouTube, etc.) "
"to pick the correct skill."
)
def build_classifier_messages(user_content: str) -> list[dict[str, str]]:
return [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": user_content},
]
def build_intent_messages(user_content: str) -> list[dict[str, str]]:
return [
{"role": "system", "content": INTENT_SYSTEM_PROMPT},
{"role": "user", "content": user_content},
]