A mixed-language prompt should identify the requested action, relevant entities, and preferred response language as distinct fields. Do not infer account authority from the language used, and do not translate immutable identifiers such as order IDs or tracking codes. A request may contain borrowed technical terms, transliterated words, or a quoted message from another person; language detection over the entire string can therefore be misleading. Ask for clarification only when the intended action or reply language is material and unresolved. The application still checks account scope before retrieving private order data.
Mixed-language requests: separate intent from reply language
Operational case
A customer writes, 'Refund kab milega for OR-958? Please answer in English.' The action is a refund-status read, the order identifier remains OR-958, and the reply locale is English despite the Hindi phrase. A second message says, 'My colleague wrote ¿Dónde está mi pedido?; what does it mean?' That is a translation request, not evidence that the customer owns a Spanish-language order. The assistant records intent and language preference separately, checks ownership only for the refund-status tool, and avoids fabricating a refund date if the status record is missing.
Input A: Refund kab milega for OR-958? Answer in English.
Intent: refund_status_read; entity: OR-958; reply: English.
Gate: authenticated owner before private lookup.
Input B: What does '¿Dónde está mi pedido?' mean?
Intent: translate quoted text; no order lookup or ownership claim.Performance and operating cost
Extracting I intent fields from a short request is O(I) structured output work after one model call, but ambiguous code-switching can raise review volume. A separate deterministic ownership check is generally cheaper than another model round. Test mixed scripts, transliteration, quoted foreign text, and explicit reply preferences; a single majority-language label cannot capture all of them. Keep the original text for authorized review because normalization can erase distinctions, but avoid logging sensitive customer details in broad analytics. Measure wrong-action routing and wrong-language replies separately.
Common Mistakes
- Do not treat quoted foreign text as the user's chosen reply language.
- Do not translate an order identifier.
- Do not let a language classification authorize an account lookup.
Connected lessons
- Prompt engineering applications
- Prompt Engineering
- Request risk routing: classify the action before choosing a response
- Clarification gates: ask only when a missing fact changes the outcome
- Classification prompts: write the label boundary first
- Translation prompts: preserve terms and machine placeholders
- Locale-aware prompts: keep values typed until rendering
- Cross-language retrieval: keep policy meaning attached to its source
- Cross-locale evaluation: compare decisions, not word-for-word text
- Project: release a multilingual order notice safely
- Multilingual prompt workflow decisions
Continue with: Localization prompts: test mixed-direction identifiers.
