Move every LLM prompt that had a zh variant into one registry, hy_memory/prompts/, with one module per language (en, zh-Hans, zh-Hant, ja, es, de, pt, fr, ko, ru, id). Call sites look prompts up with get_prompt(name, language), so a new language needs only a new module. The en and zh-Hans strings are moved verbatim, a test pins their sha256, and the old names (prompts_zh.*_ZH, extractor.EXTRACT_SYSTEM_PROMPT, ...) still import. Add an optional language: MemoryConfig.language (env MEMORY_LANGUAGE) as the client default, plus a per-call language= on add / async_add, add_extracted, finalize_session, evolve and sweep. It goes through extract and basic profile, reconcile and search query, the coding extractor and both coding reconcilers with the chain summary, the episode and topic summaries, and System 2. Codes are validated, with aliases (zh, zh-CN, zh-TW, zh-HK, pt-BR); an unknown code raises ValueError. With an explicit language, memories are written in that language. Without one, the zh/en auto-detection is unchanged. The server accepts language on /add and /add_extracted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
14 lines
542 B
Python
14 lines
542 B
Python
# -*- coding: utf-8 -*-
|
||
"""HY Memory working/coding 链路使用的中文提示词模板(兼容入口)。
|
||
|
||
文本已迁到 ``hy_memory/prompts/zh_hans.py``(``CODING_*``),这里保留旧名字。
|
||
"""
|
||
|
||
from ..prompts.zh_hans import ( # noqa: F401
|
||
CODING_CHAIN_SUMMARY_PROMPT as CHAIN_SUMMARY_PROMPT_ZH,
|
||
CODING_EXTRACT_PROMPT as EXTRACT_PROMPT_ZH,
|
||
CODING_EXTRACT_PROMPT_CODING as EXTRACT_PROMPT_CODING_ZH,
|
||
CODING_FACT_RECONCILE_PROMPT as FACT_RECONCILE_PROMPT_ZH,
|
||
CODING_RECONCILE_PROMPT as RECONCILE_PROMPT_ZH,
|
||
)
|