Detect language
ai_detect_languageDetects the language and writing system of text or a file, returning top candidates with scores, ISO codes, and script shares; useful for routing, filtering, or validating multilingual content.
Instructions
Detect the language of a text with franc-min (82 languages with 8M+ speakers, ISO 639-3 codes) and the writing systems it uses (Latin, Arabic, Cyrillic, Han/CJK, Hangul, Devanagari, Greek, Hebrew, Thai…). Returns the top 3 candidates with scores (1 = best match, relative to the others), English names and ISO 639-1 codes where they exist, plus a share per script. Texts under 20 characters are "too short": only the script is reported. Works best on a sentence or more of one language; for mixed text the dominant script wins; long texts are judged on their first 100,000 characters. Hebrew is not among the languages (script only). Give "text" or "path" (file path or base64).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| only | No | Restrict to these ISO 639-3 codes (e.g. ["arb","eng","fra"]). | |
| path | No | Or: a UTF-8 text/markdown file, as a local path or base64 (raw or a data: URI). | |
| text | No | The text (inline). |