Use prefetch_related for the openai_config when retrieving all chatmodeloptions async

This commit is contained in:
sabaimran
2024-09-12 22:45:43 -07:00
parent 253ca92203
commit 2a4416d223

View File

@@ -763,7 +763,7 @@ class ConversationAdapters:
@staticmethod
async def aget_all_conversation_configs():
return await sync_to_async(list)(ChatModelOptions.objects.all())
return await sync_to_async(list)(ChatModelOptions.objects.prefetch_related("openai_config").all())
@staticmethod
def get_vision_enabled_config():