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:
@@ -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. กรุณาตอบเป็นภาษาไทยเท่านั้น ห้ามใช้ภาษาอื่น"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user