fix: 3 fixes for Step 2, Step 4, Step 5

1. Step 5: Use empty model_config_dict={} so camel-ai doesn't spread
   api_key into create() - AsyncOpenAI reads env vars automatically.
   Step 3 unaffected (same env vars, just cleaner ModelFactory call).

2. Step 2: Fix Thai text truncation - isalnum() stripped Thai chars.
   Use re.sub(r'[^\w]', '', username, re.UNICODE) instead.

3. Step 4: Move get_language_instruction() to START of prompt (not end)
   and strengthen wording with MUST/IMPORTANT prefix.
This commit is contained in:
Kunthawat Greethong
2026-06-22 10:57:57 +07:00
parent 270c92ed05
commit afc7afa2f5
6 changed files with 279 additions and 293 deletions

View File

@@ -1,11 +1,11 @@
{
"zh": {
"label": "中文",
"llmInstruction": "请使用中文回答。"
"llmInstruction": "重要:你必须使用中文撰写所有内容。请使用中文回答。"
},
"en": {
"label": "English",
"llmInstruction": "Please respond in English."
"llmInstruction": "IMPORTANT: You MUST write ALL content exclusively in English. Do NOT use any other language in your response."
},
"es": {
"label": "Español",
@@ -29,6 +29,6 @@
},
"th": {
"label": "ไทย",
"llmInstruction": "กรุณาตอบเป็นภาษาไทย"
"llmInstruction": "IMPORTANT: You MUST write ALL content exclusively in Thai language (ภาษาไทย). Do NOT use any other language in your response. กรุณาตอบเป็นภาษาไทยเท่านั้น ห้ามใช้ภาษาอื่น"
}
}
}