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).
This commit is contained in:
Kunthawat Greethong
2026-06-18 10:33:10 +07:00
parent 31d1ebd49b
commit 3ba42db6e2
3 changed files with 5 additions and 21 deletions

View File

@@ -454,17 +454,11 @@ class TwitterSimulationRunner:
print(f"LLM配置: model={llm_model}, base_url={llm_base_url[:40] if llm_base_url else '默认'}...")
# Build model config dict for camel-ai
model_config = {"model_type": llm_model}
if llm_api_key:
model_config["api_key"] = llm_api_key
if llm_base_url:
model_config["base_url"] = llm_base_url
# camel-ai reads OPENAI_API_KEY from env automatically
return ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=llm_model,
model_config_dict=model_config,
)
def _get_active_agents_for_round(