fix: Step 5 — camel-ai reads OPENAI_API_BASE_URL not OPENAI_BASE_URL

Root cause found in container: camel-ai v0.2.78 openai_model.py L117 reads
os.environ.get('OPENAI_API_BASE_URL') — NOT OPENAI_BASE_URL.

Fix: Set BOTH env vars (OPENAI_BASE_URL for OpenAI SDK + OPENAI_API_BASE_URL for camel-ai).
Keep model_config_dict={} empty so nothing spreads to create().

Also fix Step 2 Thai truncation: \w regex doesn't match Thai tone marks (Mn category).
Use explicit Unicode range \u0E00-\u0E7F instead.
This commit is contained in:
Kunthawat Greethong
2026-06-22 11:42:56 +07:00
parent afc7afa2f5
commit 0e263f0490
4 changed files with 5 additions and 2 deletions

View File

@@ -277,9 +277,9 @@ class OasisProfileGenerator:
"""Generate a username from the entity name"""
# Keep Unicode characters (Thai, Chinese, etc) and convert to lowercase
username = name.lower().replace(" ", "_")
# Only remove truly problematic characters for usernames
# Remove characters that are NOT: Thai (\u0E00-\u0E7F), ASCII alphanumeric, or underscore
import re
username = re.sub(r'[^\w]', '', username, flags=re.UNICODE)
username = re.sub(r'[^\u0E00-\u0E7Fa-zA-Z0-9_]', '', username)
# Add random suffix to avoid duplicates
suffix = random.randint(100, 999)