fix(i18n): replace remaining hardcoded language directives in LLM prompts

- oasis_profile_generator: replace hardcoded "使用中文" with dynamic get_language_instruction()
- ontology_generator: remove hardcoded "(中文)" from schema annotation
- report_agent: replace Chinese-specific language consistency rules with language-neutral ones
- zep_tools: dynamically select quote style based on locale
This commit is contained in:
ghostubborn
2026-04-01 15:55:04 +08:00
parent fbaa3dbbeb
commit f75c6487b3
4 changed files with 13 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ from zep_cloud.client import Zep
from ..config import Config
from ..utils.logger import get_logger
from ..utils.locale import get_language_instruction
from .zep_entity_reader import EntityNode, ZepEntityReader
logger = get_logger('mirofish.oasis_profile')
@@ -670,8 +671,8 @@ class OasisProfileGenerator:
def _get_system_prompt(self, is_individual: bool) -> str:
"""获取系统提示词"""
base_prompt = "你是社交媒体用户画像生成专家。生成详细、真实的人设用于舆论模拟,最大程度还原已有现实情况。必须返回有效的JSON格式所有字符串值不能包含未转义的换行符。使用中文。"
return base_prompt
base_prompt = "你是社交媒体用户画像生成专家。生成详细、真实的人设用于舆论模拟,最大程度还原已有现实情况。必须返回有效的JSON格式所有字符串值不能包含未转义的换行符。"
return f"{base_prompt}\n\n{get_language_instruction()}"
def _build_individual_persona_prompt(
self,
@@ -717,7 +718,7 @@ class OasisProfileGenerator:
重要:
- 所有字段值必须是字符串或数字,不要使用换行符
- persona必须是一段连贯的文字描述
- 使用中文(除了gender字段必须用英文male/female
- {get_language_instruction()} (gender字段必须用英文male/female)
- 内容要与实体信息保持一致
- age必须是有效的整数gender必须是"male""female"
"""
@@ -766,7 +767,7 @@ class OasisProfileGenerator:
重要:
- 所有字段值必须是字符串或数字不允许null值
- persona必须是一段连贯的文字描述不要使用换行符
- 使用中文(除了gender字段必须用英文"other"
- {get_language_instruction()} (gender字段必须用英文"other")
- age必须是整数30gender必须是字符串"other"
- 机构账号发言要符合其身份定位"""