"""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": ""}. ' "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": "", "parameters": {}}. ' "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}, ]