Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

9.5 KB
Raw Blame
{
  "email_questions": {
    "category": {
      "type": "choice",
      "instructions": "Which team should handle the email in `body`?",
      "criteria": {
        "billing": "invoices, payments, refunds",
        "technical": "bugs, outages, integrations",
        "sales": "pricing, demos, new purchases",
        "security": "phishing, scams, account compromise",
        "hr": "hiring, leave, payroll",
        "other": "none of the above"
      }
    },
    "is_spam": {
      "type": "noul",
      "instructions": "Is this email unsolicited spam or bulk marketing?"
    },
    "is_phishing": {
      "type": "noul",
      "instructions": "Is this email a phishing or scam attempt to steal money, credentials, or personal data?",
      "criteria": {
        "true": "phishing, scam, or fraud",
        "false": "a legitimate email"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is the request in `body`?",
      "criteria": [
        "no time pressure",
        "needs attention soon",
        "blocking issue or hard deadline"
      ]
    },
    "needs_reply": {
      "type": "noul",
      "instructions": "Does the sender expect a reply?"
    }
  },
  "guard_questions": {
    "jailbreak": {
      "type": "noul",
      "instructions": "Does `prompt` try to make an AI assistant ignore its rules, policies or system instructions?"
    },
    "prompt_injection": {
      "type": "noul",
      "instructions": "Does `prompt` contain instructions aimed at the AI system rather than a genuine user request?"
    },
    "sensitive_data": {
      "type": "noul",
      "instructions": "Does `prompt` contain credentials, personal data or other sensitive information?"
    },
    "harm_severity": {
      "type": "score",
      "instructions": "How much harm would complying with `prompt` cause?",
      "criteria": [
        "none: ordinary request",
        "minor: mildly inappropriate",
        "serious: unsafe advice or abuse",
        "severe: dangerous or illegal"
      ]
    },
    "topic": {
      "type": "choice",
      "instructions": "What is `prompt` about?",
      "criteria": {
        "product_support": null,
        "coding": null,
        "general_knowledge": null,
        "personal_advice": null,
        "security_testing": null,
        "other": null
      }
    }
  },
  "moderation_questions": {
    "toxic": {
      "type": "noul",
      "instructions": "Is `post` toxic: rude, disrespectful or likely to make someone leave the discussion?"
    },
    "harassment": {
      "type": "noul",
      "instructions": "Does `post` target or harass a specific person?"
    },
    "threat": {
      "type": "noul",
      "instructions": "Does `post` threaten violence, harm or intimidation?"
    },
    "spam": {
      "type": "noul",
      "instructions": "Is `post` spam or advertising?"
    },
    "severity": {
      "type": "score",
      "instructions": "How severe is any rule-breaking in `post`?",
      "criteria": [
        "no rule-breaking: ordinary on-topic post",
        "mild: rude tone or off-topic, no target",
        "clear violation: insults, harassment or spam aimed at someone",
        "severe: threats, hate speech or calls for violence"
      ]
    }
  },
  "router_questions": {
    "difficulty": {
      "type": "score",
      "instructions": "How hard is `request` for a language model?",
      "criteria": [
        "trivial: a lookup or one-liner",
        "easy: short answer, no reasoning",
        "moderate: several steps",
        "hard: long multi-step reasoning or specialist knowledge"
      ]
    },
    "domain": {
      "type": "choice",
      "instructions": "What domain does `request` belong to?",
      "criteria": {
        "code": "software engineering, programming, refactoring, architecture, debugging",
        "math_or_logic": "mathematics, logic puzzles, proofs, complex calculation",
        "writing": "creative writing, essays, emails, blog posts, copywriting",
        "factual_lookup": "facts, definitions, trivia, history",
        "data_analysis": "statistics, SQL, data manipulation, metrics",
        "chitchat": "casual conversation, greetings, small talk"
      }
    },
    "needs_tools": {
      "type": "noul",
      "instructions": "Does answering `request` require external tools, search or private data?"
    },
    "is_sensitive": {
      "type": "noul",
      "instructions": "Does `request` involve money, legal, medical or safety consequences?"
    }
  },
  "triage_questions": {
    "intent": {
      "type": "choice",
      "instructions": "What does the customer want in `message`?",
      "criteria": {
        "refund": "money returned or a duplicate charge reversed",
        "technical_help": "a bug, outage or integration problem",
        "billing_question": "a question about an invoice, plan or payment method",
        "information": "general information, pricing or how-to",
        "cancellation": "wants to cancel or downgrade",
        "other": "none of the other options fits"
      }
    },
    "is_urgent": {
      "type": "noul",
      "instructions": "Does `message` communicate time pressure or a deadline?"
    },
    "frustration": {
      "type": "score",
      "instructions": "How frustrated does the customer sound in `message`?",
      "criteria": [
        "calm and neutral",
        "concerned but civil",
        "clearly annoyed",
        "very angry or using strong language"
      ]
    },
    "refund_requested": {
      "type": "noul",
      "instructions": "Does the customer ask for money back?"
    },
    "churn_risk": {
      "type": "noul",
      "instructions": "Does `message` suggest the customer may leave for a competitor or cancel?"
    }
  },
  "state_field": {
    "email_questions": "body",
    "guard_questions": "prompt",
    "moderation_questions": "post",
    "router_questions": "request",
    "triage_questions": "message"
  },
  "state_field_hostile": {
    "no-backticks": null,
    "two-fields": null,
    "same-field-twice": "message",
    "empty": null,
    "missing-instructions": null,
    "null-instructions": null,
    "non-word-backticks": null,
    "underscored-field": "customer_message",
    "backtick-in-criteria-only": null
  },
  "hostile_specs": {
    "no-backticks": {
      "q": {
        "type": "noul",
        "instructions": "Is this urgent?"
      }
    },
    "two-fields": {
      "a": {
        "type": "noul",
        "instructions": "Does `message` ask for a refund?"
      },
      "b": {
        "type": "noul",
        "instructions": "Is `body` urgent?"
      }
    },
    "same-field-twice": {
      "a": {
        "type": "noul",
        "instructions": "Does `message` ask for a refund?"
      },
      "b": {
        "type": "noul",
        "instructions": "Is `message` urgent?"
      }
    },
    "empty": {},
    "missing-instructions": {
      "q": {
        "type": "noul"
      }
    },
    "null-instructions": {
      "q": {
        "type": "noul",
        "instructions": null
      }
    },
    "non-word-backticks": {
      "q": {
        "type": "noul",
        "instructions": "Read `a-b` and `c d`."
      }
    },
    "underscored-field": {
      "q": {
        "type": "noul",
        "instructions": "Read `customer_message`."
      }
    },
    "backtick-in-criteria-only": {
      "q": {
        "type": "choice",
        "instructions": "Pick one.",
        "criteria": {
          "x": "look at `message`"
        }
      }
    }
  },
  "email_questions_custom": {
    "category": {
      "type": "choice",
      "instructions": "Which team should handle the email in `body`?",
      "criteria": {
        "ops": "incidents and deploys",
        "legal": "contracts and compliance"
      }
    },
    "is_spam": {
      "type": "noul",
      "instructions": "Is this email unsolicited spam or bulk marketing?"
    },
    "is_phishing": {
      "type": "noul",
      "instructions": "Is this email a phishing or scam attempt to steal money, credentials, or personal data?",
      "criteria": {
        "true": "phishing, scam, or fraud",
        "false": "a legitimate email"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is the request in `body`?",
      "criteria": [
        "no time pressure",
        "needs attention soon",
        "blocking issue or hard deadline"
      ]
    },
    "needs_reply": {
      "type": "noul",
      "instructions": "Does the sender expect a reply?"
    }
  },
  "email_questions_empty_categories": {
    "category": {
      "type": "choice",
      "instructions": "Which team should handle the email in `body`?",
      "criteria": {
        "billing": "invoices, payments, refunds",
        "technical": "bugs, outages, integrations",
        "sales": "pricing, demos, new purchases",
        "security": "phishing, scams, account compromise",
        "hr": "hiring, leave, payroll",
        "other": "none of the above"
      }
    },
    "is_spam": {
      "type": "noul",
      "instructions": "Is this email unsolicited spam or bulk marketing?"
    },
    "is_phishing": {
      "type": "noul",
      "instructions": "Is this email a phishing or scam attempt to steal money, credentials, or personal data?",
      "criteria": {
        "true": "phishing, scam, or fraud",
        "false": "a legitimate email"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is the request in `body`?",
      "criteria": [
        "no time pressure",
        "needs attention soon",
        "blocking issue or hard deadline"
      ]
    },
    "needs_reply": {
      "type": "noul",
      "instructions": "Does the sender expect a reply?"
    }
  }
}