Fix sync to async issue when getting default chat model in hidden agent configuration API

This commit is contained in:
sabaimran
2025-01-21 12:06:09 -08:00
parent e518626027
commit c1b0a9f8d4

View File

@@ -815,7 +815,7 @@ class AgentAdapters:
is_hidden: Optional[bool] = False,
):
if not chat_model:
chat_model = ConversationAdapters.get_default_chat_model(user)
chat_model = await ConversationAdapters.aget_default_chat_model(user)
chat_model_option = await ChatModel.objects.filter(name=chat_model).afirst()
# Slug will be None for new agents, which will trigger a new agent creation with a generated, immutable slug