Commit Graph

290 Commits

Author SHA1 Message Date
Kunthawat Greethong
0e263f0490 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.
2026-06-22 11:42:56 +07:00
Kunthawat Greethong
afc7afa2f5 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.
2026-06-22 10:57:57 +07:00
Kunthawat Greethong
270c92ed05 fix: 3 fixes - camel-ai env var, Thai font, model_config_dict
1. Restore OPENAI_API_KEY/OPENAI_BASE_URL env vars for camel-ai factory check
   (keep api_key/base_url in model_config_dict for client constructor)
2. Add Thai-supporting font-family to .profile-realname
   (JetBrains Mono doesn't render Thai diacritics)
3. Keep model_config_dict with api_key and base_url for camel-ai client
2026-06-22 10:20:44 +07:00
Kunthawat Greethong
cfaa6e8b8d fix: pass api_key/base_url via model_config_dict, not env vars
camel-ai v0.2.78 reads OPENAI_API_KEY from env and auto-passes it to
chat.completions.create() which doesn't accept it (TypeError).

Fix: pass api_key and base_url through model_config_dict so camel-ai
extracts them for the OpenAI client constructor only.
2026-06-18 20:12:51 +07:00
Kunthawat Greethong
3ba42db6e2 fix: revert to env var approach for camel-ai LLM config
model_config_dict passes values to create() call, not client constructor.
api_key in model_config_dict causes 'unexpected keyword argument' error.
Revert to env vars: OPENAI_API_KEY + OPENAI_BASE_URL (camel-ai reads both).
2026-06-18 10:33:10 +07:00
Kunthawat Greethong
31d1ebd49b fix: pass model_type as positional arg to camel-ai ModelFactory.create
model_type must be a separate argument, not inside model_config_dict.
Also ensure all 3 scripts have consistent ModelFactory.create calls.
2026-06-18 09:17:34 +07:00
Kunthawat Greethong
b30ed19b16 fix: pass base_url and api_key directly to camel-ai ModelFactory
camel-ai does not read OPENAI_BASE_URL env var reliably.
Pass api_key and base_url via model_config_dict instead.
2026-06-17 22:30:59 +07:00
Kunthawat Greethong
7c3e219a6f fix: CSS syntax error in survey-env-warning placement 2026-06-17 21:58:00 +07:00
Kunthawat Greethong
7f04bc44fb fix: use correct env var OPENAI_BASE_URL for camel-ai LLM routing
camel-ai's OpenAI model reads OPENAI_BASE_URL, not OPENAI_API_BASE_URL.
This caused all simulation LLM calls to go to api.openai.com instead of
the configured provider (DeepSeek, Xiaomi Mimo, etc), resulting in 401.
2026-06-17 21:46:45 +07:00
Kunthawat Greethong
2bb1afab68 fix: extract actual error message from backend error responses
The error interceptor was re-throwing the generic axios Error object
instead of extracting the actual error message from the response body.
Now extracts error.response.data.error for meaningful error messages.
2026-06-17 21:40:21 +07:00
Kunthawat Greethong
5224c6df79 fix: show actual error details in chat error messages
- Extract error from err.response.data.error (axios error response)
- Log full error to console for debugging
- Show actual backend error message instead of generic 'Error'
2026-06-17 21:38:19 +07:00
Kunthawat Greethong
55a430db62 fix: show env status warning in survey tab + add alert on survey failure
- Add isEnvAlive check on mount via /api/simulation/env-status
- Show warning banner when simulation env is not running
- Add alert() on survey failure for visibility
- Add envNotRunning translation key for th/en/zh
2026-06-17 21:35:08 +07:00
Kunthawat Greethong
fa3160f67e fix: show visible error alert when survey fails (e.g. simulation env not running) 2026-06-17 19:37:55 +07:00
Kunthawat Greethong
431b66fd85 fix: translate remaining Chinese in sim config and profile prompts
- Time config: translate all Chinese instructions and field descriptions
- Event config: translate hot topics/narrative direction instructions
- Agent config: translate entity type descriptions and field labels
- Profile generator: translate all persona prompt fields and instructions
- Country field: changed from 'use Chinese' to 'use English'
2026-06-17 19:36:05 +07:00
Kunthawat Greethong
5fcce79361 fix: translate Chinese prompts to English in simulation config and profile generators
- simulation_config_generator.py: translate all LLM prompts and system messages
- oasis_profile_generator.py: translate profile generation prompts

Ensures get_language_instruction() controls output language instead of
being overridden by Chinese prompt context.
2026-06-17 15:52:38 +07:00
Kunthawat Greethong
bf14c56944 fix: translate ONTOLOGY_SYSTEM_PROMPT from Chinese to English 2026-06-17 15:32:47 +07:00
Kunthawat Greethong
e766bc625a fix: translate all Chinese prompts to English in zep_tools.py
- Interview prompt prefix: Chinese -> English
- Sub-query decomposition: Chinese -> English
- Agent selection: Chinese -> English
- Interview questions: Chinese -> English
- Interview summary: Chinese -> English
- Error messages: Chinese -> English
- to_text() labels: Chinese -> English

This ensures get_language_instruction() actually controls output language
instead of being overridden by Chinese prompt context.
2026-06-17 15:28:00 +07:00
Kunthawat Greethong
8a09a49029 feat: add Thai language support (100% Thai UI)
- Add locales/th.json with 629 translated keys
- Add Thai to languages.json with llmInstruction for report generation
- Backend auto-loads new locale files from locales/ directory
2026-06-17 12:38:33 +07:00
Kunthawat Greethong
9f2232d40b feat: support cross-origin deployment with VITE_API_BASE_URL
- Set VITE_API_BASE_URL=https://opinion-api.moreminimore.com for
  frontend-backend split deployment
- Vite proxy also uses API_BACKEND_URL env var as target
- Falls back to same-origin proxy for local dev
2026-06-17 12:11:22 +07:00
Kunthawat Greethong
aadc11ad83 fix: use relative baseURL so API calls go through vite proxy
When deployed behind a reverse proxy (e.g. opinion.moreminimore.com),
hardcoding http://localhost:5001 causes the browser to try connecting
to the user's own machine. Empty baseURL + vite proxy fixes this.
2026-06-17 12:08:04 +07:00
Kunthawat Greethong
cbe861ff27 fix: use allowedHosts=true (boolean), disable open in container 2026-06-17 11:57:24 +07:00
Kunthawat Greethong
26cdd14881 fix: use VITE_ALLOWED_HOSTS env var, default to 'all' 2026-06-17 11:55:56 +07:00
Kunthawat Greethong
0cdcc79125 fix: allow all hosts in vite dev server 2026-06-17 11:47:38 +07:00
Kunthawat Greethong
3ea51d906a fix: allow opinion.moreminimore.com host in vite config 2026-06-17 11:46:59 +07:00
Kunthawat Greethong
f395309207 feat: add DeepSeek and Xiaomi MiMo LLM provider presets
- Add providers.py with 5 provider presets (OpenAI, DeepSeek, Xiaomi MiMo, Alibaba DashScope, MiniMax)
- Add LLM_PROVIDER env var for one-line provider switching
- Improve <think> tag stripping for reasoning models
- Add .env.example with documented configuration
- Update README with provider configuration section
2026-06-17 11:13:34 +07:00
BaiFu
96096ea0ff Merge pull request #640 from lllopic/fix/add-type-hints-and-helper-method
refactor: add type hints and FileParser.is_supported() helper
2026-05-25 00:48:57 +08:00
666ghj
3f4d56116c fix(backend): constrain Python version to 3.11-3.12 2026-05-24 22:59:36 +08:00
BaiFu
db1bc144ff Merge pull request #641 from YunyueLi/docs/readme-polish
docs(readme): fix typo in Shanda logo alt text
2026-05-24 02:02:46 +08:00
YunyueLi
faa151131c docs(readme): fix typo in Shanda logo alt text
The Shanda sponsor logo's alt text was `666ghj%2MiroFish | Shanda`,
missing the `F` from the URL-encoded `/`. Every other badge in both
READMEs uses the correct `666ghj%2FMiroFish`. Bring this one in line
with the rest.
2026-05-23 16:30:55 +08:00
lllopic
daec4b6be4 refactor: add type hints and FileParser.is_supported() helper
- Add return type annotation (list[str]) to Config.validate()
- Add type annotations (msg: str, -> None) to logger convenience functions
- Add FileParser.is_supported() classmethod for checking file format support
2026-05-23 14:57:46 +08:00
666ghj
fa0f6519b1 docs: rename README-EN.md to README.md as default English documentation 2026-04-02 16:52:29 +08:00
666ghj
0e9420e0f8 docs: rename README.md to README-ZH.md for Chinese documentation 2026-04-02 16:52:29 +08:00
BaiFu
7d07fb7f03 Merge pull request #440 from Ghostubborn/fix/security-deps
fix(security): 修复前端 3 个高危依赖漏洞
2026-04-02 15:17:46 +08:00
ghostubborn
223b283da7 fix(security): upgrade axios, rollup, picomatch to fix 3 high severity vulnerabilities 2026-04-02 15:00:33 +08:00
BaiFu
af71244974 Merge pull request #428 from Ghostubborn/feat/i18n
feat(i18n): 添加多语言切换功能,支持中英文
2026-04-02 14:27:04 +08:00
ghostubborn
ed465908db fix(i18n): set HTML lang attribute before Vue mounts via inline script 2026-04-02 14:21:09 +08:00
ghostubborn
65df257e19 chore(deps): upgrade vue-i18n from v9 to v11 2026-04-02 14:20:50 +08:00
ghostubborn
f2404903d6 fix(i18n): validate Accept-Language header against registered locales 2026-04-02 14:20:15 +08:00
ghostubborn
2421010fe1 fix(i18n): fix English workflow desc font size with correct CSS selectors 2026-04-01 19:11:22 +08:00
ghostubborn
3929c3ade2 fix(i18n): further shorten English metrics and improve workflow layout 2026-04-01 19:07:19 +08:00
ghostubborn
21922da6cc fix(i18n): improve English layout for homepage left-pane and report title
- Add sans-serif font for English left-pane (status, workflow sections)
- Shorten English workflow step descriptions
- Reduce English report title font-size from 36px to 28px
2026-04-01 19:04:38 +08:00
ghostubborn
c6cafdd532 fix(i18n): translate world1/world2 platform labels in interview tool display 2026-04-01 18:38:22 +08:00
ghostubborn
5072a2eaa8 feat(i18n): replace Chinese UI text in Step4Report.vue render functions
Only UI display text is replaced. Regex parsing patterns are kept as-is
since they match the backend output format.
2026-04-01 18:35:18 +08:00
ghostubborn
6db3f98a48 fix(i18n): fix English homepage layout with proper font and shorter copy
- Use sans-serif font for English titles, descriptions and navbar
- Shorten English hero text to avoid overflow
- Fix :global() scoped CSS issue that was setting root font-size to 3.5rem
- Use separate unscoped style block for html[lang] selectors
2026-04-01 18:04:05 +08:00
ghostubborn
24e9bee5be feat(i18n): replace all user-visible Chinese logger messages in zep_tools.py
These are shown to users via ConsoleLogger in the report page.
2026-04-01 17:46:39 +08:00
ghostubborn
e79569ab4f feat(i18n): replace all user-visible Chinese in report_agent.py
Covers ReportLogger message fields and logger messages shown via ConsoleLogger.
2026-04-01 17:44:52 +08:00
ghostubborn
1d358fc492 feat(i18n): replace expand/collapse Chinese text in Step4Report.vue 2026-04-01 17:44:45 +08:00
666ghj
e3350a919d fix(graph): enforce PascalCase for entity names and SCREAMING_SNAKE_CASE for edge names in ontology validation 2026-04-01 17:42:27 +08:00
ghostubborn
380e456d41 fix(i18n): replace hardcoded Chinese stage names in simulation prepare SSE 2026-04-01 17:31:00 +08:00
ghostubborn
3a8451c119 feat(i18n): replace remaining hardcoded Chinese in frontend addLog calls 2026-04-01 17:21:55 +08:00