mirror of
https://github.com/666ghj/MiroFish.git
synced 2026-05-19 07:42:57 +00:00
fix(i18n): protect JSON field values from language instruction in config generator
Ensure poster_type stays PascalCase English and stance stays English enum values regardless of language setting. Only natural language fields follow the user's language preference.
This commit is contained in:
parent
97aa58384e
commit
da2490ec31
1 changed files with 2 additions and 2 deletions
|
|
@ -703,7 +703,7 @@ class SimulationConfigGenerator:
|
|||
}}"""
|
||||
|
||||
system_prompt = "你是舆论分析专家。返回纯JSON格式。注意 poster_type 必须精确匹配可用实体类型。"
|
||||
system_prompt = f"{system_prompt}\n\n{get_language_instruction()}"
|
||||
system_prompt = f"{system_prompt}\n\n{get_language_instruction()}\nIMPORTANT: The 'poster_type' field value MUST be in English PascalCase exactly matching the available entity types. Only 'content', 'narrative_direction', 'hot_topics' and 'reasoning' fields should use the specified language."
|
||||
|
||||
try:
|
||||
return self._call_llm_with_retry(prompt, system_prompt)
|
||||
|
|
@ -867,7 +867,7 @@ class SimulationConfigGenerator:
|
|||
}}"""
|
||||
|
||||
system_prompt = "你是社交媒体行为分析专家。返回纯JSON,配置需符合中国人作息习惯。"
|
||||
system_prompt = f"{system_prompt}\n\n{get_language_instruction()}"
|
||||
system_prompt = f"{system_prompt}\n\n{get_language_instruction()}\nIMPORTANT: The 'stance' field value MUST be one of the English strings: 'supportive', 'opposing', 'neutral', 'observer'. All JSON field names and numeric values must remain unchanged. Only natural language text fields should use the specified language."
|
||||
|
||||
try:
|
||||
result = self._call_llm_with_retry(prompt, system_prompt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue