fix: add null check for llm config update [LET-6340] (#6407)

fix: add null check for llm config update
This commit is contained in:
cthomas
2025-11-25 17:10:54 -08:00
committed by Caren Thomas
parent 6b64842c48
commit 776564fc8a

View File

@@ -541,6 +541,10 @@ class SyncServer(object):
# update with model_settings
if request.model_settings is not None:
if request.llm_config is None:
# Get the current agent's llm_config if not already set
agent = await self.agent_manager.get_agent_by_id_async(agent_id=agent_id, actor=actor)
request.llm_config = agent.llm_config.model_copy()
update_llm_config_params = request.model_settings._to_legacy_config_params()
request.llm_config = request.llm_config.model_copy(update=update_llm_config_params)