MicroFish/backend/scripts
Dominik Seemann 080683295d feat(i18n): translate ontology_generator prompts to english
translate the system prompt constant and the user-message template in
backend/app/services/ontology_generator.py from chinese to english.
the chinese base prompt was biasing the model toward chinese structure
and word choice even when accept-language was en, leaving ontology
descriptions and analysis_summary fields chinese-flavoured.

translation is in-place and preserves every functional contract: the
json output schema, the entity-type and relationship-type taxonomies
verbatim, the reserved-attribute-name list, the count and length
constraints, and all f-string interpolations. the
get_language_instruction() postfix call site and the trailing english
identifier-format directive are unchanged, so zh and other locales
continue to receive locale-appropriate descriptions.

logger calls, docstrings, and inline comments are intentionally left
in chinese — they are owned by issues #6 and #7.

a small static guard script (backend/scripts/test_ontology_prompts_no_cjk.py)
ast-parses the module and asserts zero cjk in the system prompt and in
every string literal of _build_user_message except the docstring, so
the regression cannot reappear silently.

Closes #2
2026-05-07 09:40:27 +00:00
..
action_logger.py Enhance simulation management and logging features 2025-12-02 17:11:47 +08:00
run_parallel_simulation.py Add UTF-8 encoding support for Windows in simulation_runner.py and run_parallel_simulation.py to resolve character encoding issues with third-party libraries. 2025-12-26 18:14:57 +08:00
run_reddit_simulation.py Enhance signal handling and suppress warnings in simulation scripts 2025-12-09 00:37:12 +08:00
run_twitter_simulation.py Enhance signal handling and suppress warnings in simulation scripts 2025-12-09 00:37:12 +08:00
test_ontology_prompts_no_cjk.py feat(i18n): translate ontology_generator prompts to english 2026-05-07 09:40:27 +00:00
test_profile_format.py Enhance backend functionality with OASIS simulation features 2025-12-01 15:03:44 +08:00