Fallback to default agent for chat when unset in get conversation API

This commit is contained in:
Debanjum
2025-03-28 00:49:33 +05:30
parent a387f638cd
commit 03de2803f0

View File

@@ -119,6 +119,8 @@ async def get_agent_by_conversation(
media_type="application/json",
status_code=404,
)
if not conversation.agent:
agent = await AgentAdapters.aget_default_agent()
agent = await AgentAdapters.aget_agent_by_slug(conversation.agent.slug, user)