From 9e0a2c7a9812c3e894c086771fbb499e1bbe6f2f Mon Sep 17 00:00:00 2001 From: Debanjum Date: Sat, 30 Nov 2024 19:12:03 -0800 Subject: [PATCH] Restrict generated chat title to 200 chars limit allowed for chat slug --- src/khoj/routers/api_chat.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/khoj/routers/api_chat.py b/src/khoj/routers/api_chat.py index d0833eec..92de0294 100644 --- a/src/khoj/routers/api_chat.py +++ b/src/khoj/routers/api_chat.py @@ -562,8 +562,7 @@ async def generate_chat_title( raise HTTPException(status_code=404, detail="Conversation not found") new_title = await acreate_title_from_history(request.user.object, conversation=conversation) - - conversation.slug = new_title + conversation.slug = new_title[:200] await conversation.asave()