Skip to content

Commit

Permalink
Use prefetch_related for the openai_config when retrieving all chatmo…
Browse files Browse the repository at this point in the history
…deloptions async
  • Loading branch information
sabaimran committed Sep 13, 2024
1 parent 253ca92 commit 2a4416d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/khoj/database/adapters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def get_all_conversation_configs():

@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():
Expand Down

0 comments on commit 2a4416d

Please sign in to comment.