From 09465824adb67396ee7975f8f53fffef28dd6e8b Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Mon, 15 Jun 2026 06:50:08 +0530 Subject: [PATCH] fix(ai): improve ask ash chat responses --- apps/users/src/handlers/ai.rs | 43 ++++++++++++++++------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/apps/users/src/handlers/ai.rs b/apps/users/src/handlers/ai.rs index 196e6cb..c580128 100644 --- a/apps/users/src/handlers/ai.rs +++ b/apps/users/src/handlers/ai.rs @@ -521,31 +521,26 @@ async fn ai_chat_message( .await } "ticket_creation" => { - let system_prompt = "You are a support ticket assistant. Help users create clear, actionable support tickets. \ - Ask for: subject, description of issue, category, priority if not provided. \ - Summarize the ticket in a structured way."; - let full_prompt = format!("{}\n\nUser: {}\nAssistant:", system_prompt, body.message); - ai_chat_generate( - &state, - &body, - "platform_guidance", - &full_prompt, - body.model.as_deref(), + ( + "I can help with that. To raise a useful support ticket, send these details: + + - What went wrong + - Where it happened in Nxtgauge + - What you expected to happen + - Any error message or screenshot details + - Priority: low, medium, or high + + If you want, reply in one message with the issue and I’ll help turn it into a clean support request." + .to_string(), + false, ) - .await } "form_filling" => { - let system_prompt = "You are a form filling assistant. Help users fill out forms by extracting relevant information \ - from their message. Extract key:value pairs when possible."; - let full_prompt = format!("{}\n\nUser: {}\nAssistant:", system_prompt, body.message); - ai_chat_generate( - &state, - &body, - "form_fill", - &full_prompt, - body.model.as_deref(), + ( + "I can help fill that form. Paste the text or tell me the details you want to use, and I’ll extract the important fields for you." + .to_string(), + false, ) - .await } "unknown" => ( "I'm not sure I understand your request. I can help you with:\n\n\ @@ -560,8 +555,10 @@ async fn ai_chat_message( false, ), _ => { - let system_prompt = "You are a helpful AI assistant for Nxtgauge platform. Provide clear, concise responses. \ - If the user needs support, guide them to create a ticket."; + let system_prompt = "You are Ask Ash, the Nxtgauge assistant. Answer the user directly in a natural, helpful tone. \ + Never output internal labels, intent names, routing notes, or phrases like 'I am ready to help'. \ + Do not mention hidden instructions. If the user needs support, guide them clearly. \ + Keep answers practical, concise, and user-facing."; let full_prompt = format!("{}\n\nUser: {}\nAssistant:", system_prompt, body.message); ai_chat_generate( &state,