Skip to content

Commit 6dc8a9d

Browse files
fix: only translate terminologies in case of Chinese context
1 parent 01f5e3c commit 6dc8a9d

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

agents/matmaster_agent/prompt.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,20 @@ def get_naming_rules_text():
152152

153153

154154
def get_vocabulary_enforce_prompt() -> str:
155-
vocab_list = '\n'.join(
156-
[
157-
f'- "{k}" MUST be translated/referred to as "{v}"'
158-
for k, v in DOMAIN_SPECIFIC_VOCABULARY.items()
159-
]
155+
mapping_list = '\n'.join(
156+
[f' - "{eng}" → "{chn}"' for eng, chn in DOMAIN_SPECIFIC_VOCABULARY.items()]
160157
)
158+
161159
return f"""
162160
### DOMAIN-SPECIFIC VOCABULARY STANDARDS
163-
To ensure professional consistency in Materials Science, you strictly MUST adhere to the following terminology translations:
164-
{vocab_list}
161+
To ensure professional consistency, you strictly MUST adhere to the following terminology rules **based on your output language**:
162+
163+
**Condition A: If you are responding in CHINESE (中文):**
164+
You MUST translate the following terms into their designated Chinese equivalents:
165+
{mapping_list}
166+
167+
**Condition B: If you are responding in ENGLISH:**
168+
You MUST use the original English terms (e.g., "Deep Potential", "DPMD"). **DO NOT** use the Chinese translations in English sentences.
165169
"""
166170

167171

0 commit comments

Comments
 (0)