Files
Enterprise-Knowledge-Base/internal/application
jackson.jia c8645843c3 fix(knowledge): wrap locale code with LanguageLocaleName in wiki ingest prompts
The wiki ingest pipeline was passing raw locale codes (e.g. "zh-CN",
"en-US") directly into LLM prompts where a human-readable language name
is expected. The model would see "zh-CN" instead of "Chinese (Simplified)"
in its instructions, which could degrade output quality.

Two call sites were affected:

- SlugUpdate.Language (ProcessWikiIngest, retract path): consumed by the
  reduce phase to tell the page editor model what language to write in.
- lang variable (mapOneDocument): consumed by entity/concept extraction,
  chunk citation classification, and index page rebuild — all LLM prompts.

Wrap both with types.LanguageLocaleName() which maps locale codes to
descriptive names (e.g. "zh-CN" → "Chinese (Simplified)"). Unknown
locales fall through unchanged so no information is lost.
2026-05-30 16:56:32 +08:00
..