Governance packs generated in any language — Arabic, French, Spanish, Mandarin, and more. The engine decides what stays in English and what gets translated, intelligently.
_lang_directive() — generates the instruction appended to each prose prompt. It is intelligent: returns nothing for English (zero token overhead), adds Arabic-specific MSA guidance for Arabic, and applies a generic directive for all other languages.
def _lang_directive(self) -> str: # English → return nothing. Zero token overhead. if self.language.lower() == "english": return "" # Arabic → add MSA + RTL instruction arabic_note = ( " Use formal Modern Standard Arabic (الفصحى — MSA)." " Ensure all narrative text is right-to-left." ) if self.language.lower() in ("arabic", "العربية") else "" return ( f"\n\n---\n" f"**LANGUAGE DIRECTIVE — CRITICAL:** Generate ALL prose, headings, " f"narrative text, executive summaries, rationales, and explanatory " f"content in **{self.language}**.{arabic_note}\n" f"You MAY keep in English: standard abbreviations (ISO, EU, GDPR, NIST), " f"proper standard names, column headers, technical acronyms.\n" f"Do NOT mix languages within a paragraph or section.\n" f"---" )
risk_tier, eu_ai_act_classification, applicable_standards. These are consumed by all five prose modules to construct their prompts. If these values were in Arabic, downstream f-strings injecting them into English-language prompt templates would break or produce incoherent results. Keeping classification in English is the stability anchor for the whole pipeline.
/generate with the output_language field included.
# Start the server python app.py # POST with Arabic output language curl -X POST http://localhost:5000/generate \ -H "Content-Type: application/json" \ -d '{ "org_name": "Ministry of Digital Affairs", "initiative_name": "AI Fraud Detection System", "description": "ML system that detects fraudulent benefit claims...", "ai_types": ["Machine Learning", "Predictive Analytics"], "decision_mode": "human-in-the-loop", "public_facing": "yes", "personal_data": "yes", "data_description": "Citizen financial and identity records", "affected_populations": ["low-income households"], "people_affected": "500,000+", "geo_scope": "National", "sector": "Social Services", "key_concerns": "Bias, fairness, transparency", "output_language": "Arabic" }' # Returns {"job_id": "..."} — poll /status/{job_id} # Results page will show governance pack in Arabic