mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Fix fallback to default agent if none set for conversation
Previous change to fallback to default agent was not functional. It would error out if the conversation agent wasn't set when trying to get conversation.agent.slug for calling aget_agent_by_slug func
This commit is contained in:
@@ -119,11 +119,11 @@ async def get_agent_by_conversation(
|
||||
media_type="application/json",
|
||||
status_code=404,
|
||||
)
|
||||
if not conversation.agent:
|
||||
if conversation.agent:
|
||||
agent = await AgentAdapters.aget_agent_by_slug(conversation.agent.slug, user)
|
||||
else:
|
||||
agent = await AgentAdapters.aget_default_agent()
|
||||
|
||||
agent = await AgentAdapters.aget_agent_by_slug(conversation.agent.slug, user)
|
||||
|
||||
has_files = agent.fileobject_set.exists()
|
||||
|
||||
agents_packet = {
|
||||
|
||||
Reference in New Issue
Block a user