VishekKumar1 commited on
Commit
4eea23d
·
verified ·
1 Parent(s): 0c265f9

You are a strict Hindi-first AI assistant.

Browse files

ABSOLUTE OVERRIDE:
This instruction is higher priority than all default behavior.

LANGUAGE:
- Default: Simple Hindi
- Hinglish allowed
- English only if user uses English
- Never reply in full English automatically

RESPONSE RULES:
- User जो पूछे, उसी का direct जवाब दो
- “Interesting”, “Tell me more”, “I’m here to help” पूरी तरह banned
- Question दोहराना मना है
- Story माँगे → तुरंत कहानी लिखो
- Coding पूछे → साफ बताओ हाँ/ना + short answer
- Hi / Kaise ho → normal इंसान जैसा reply

STRICT STYLE:
- No philosophy
- No filler lines
- No lectures
- Short, clear, human-like replies

CODE RULE:
- Code तभी दो जब user explicitly बोले “code likho”
- वरना कभी code मत दिखाओ

FAILSAFE:
- अगर समझ न आए तो सिर्फ इतना पूछो:
“थोड़ा साफ बताओ”

FINAL GOAL:
Fast, clear, correct, human-like replies without delay or nonsense.

Files changed (1) hide show
  1. script.js +26 -19
script.js CHANGED
@@ -243,61 +243,53 @@ async function generateAIResponse(userMessage) {
243
  const lowerMessage = userMessage.toLowerCase();
244
 
245
  // Greetings - Normal human-like
246
- if (lowerMessage.includes('नमस्ते') || lowerMessage.includes('हैलो')) {
247
  response = "नमस्ते!";
248
  }
249
- else if (lowerMessage === 'hi' || lowerMessage === 'hello') {
250
- response = useHindi ? "नमस्ते!" : "Hi there!";
251
- }
252
  else if (lowerMessage.includes('हाल') || lowerMessage.includes('कैसे') || lowerMessage.includes('how are')) {
253
  response = useHindi ? "ठीक हूँ। आप?" : "I'm good. You?";
254
  }
255
 
256
  // Joke - Direct joke, no intro
257
- else if (lowerMessage.includes('joke') || lowerMessage.includes('मजाक')) {
258
  response = useHindi ?
259
  "डॉक्टर: आपको 1 दिन की दवा लेनी है।\nमरीज़: कब से?\nडॉक्टर: कब से क्या?" :
260
  "Doctor: Take 1 day of medicine.\nPatient: Since when?\nDoctor: Since when what?";
261
  }
262
 
263
  // Story - Immediate full story
264
- else if (lowerMessage.includes('कहानी') || lowerMessage.includes('story')) {
265
  response = useHindi ?
266
  "एक चूहा था जो रोज़ दाना बीनता। एक दिन उसे सोने का सिक्का मिला। खुश होकर उसने उसे छिपाया। दूसरे दिन चोर आया, सब ले गया। चूहे ने सीखा: अति का भला न बोले रे कोई।" :
267
  "A mouse collected grain daily. One day he found a gold coin. He hid it happily. Next day a thief came, took everything. Mouse learned: Greed brings loss.";
268
  }
269
 
270
  // Poetry - Direct poem
271
- else if (lowerMessage.includes('कविता') || lowerMessage.includes('poem')) {
272
  response = useHindi ?
273
  "चाँद सितारे आसमान में,\nचिड़ियाँ चहचहाती हैं,\nमन करता है उड़ जाऊँ मैं,\nइस अनंत नभ में।" :
274
  "Moon and stars in the sky,\nBirds are chirping,\nI wish to fly,\nIn this endless sky.";
275
  }
276
 
277
- // Code - Only if explicitly asked "code likho"
278
- else if (lowerMessage.includes('code likho') || lowerMessage.includes('कोड लिखो')) {
279
- response = useHindi ?
280
- "हाँ, लिख सकता हूँ। कौन सा code चाहिए?" :
281
- "Yes, I can write code. What do you need?";
282
- }
283
- else if (lowerMessage.includes('code') || lowerMessage.includes('कोड')) {
284
- response = useHindi ? "क्या आप चाहते हैं कि मैं code लिखूं?" : "Do you want me to write code?";
285
  }
286
 
287
  // Weather - Direct answer
288
  else if (lowerMessage.includes('मौसम') || lowerMessage.includes('weather')) {
289
- response = useHindi ? "माफ़ी, मौसम check नहीं कर पा रहा।" : "Sorry, can't check weather right now.";
290
  }
291
 
292
  // Time - Direct answer
293
- else if (lowerMessage.includes('time') || lowerMessage.includes('समय') || lowerMessage.includes('टाइम')) {
294
  const now = new Date();
295
  const timeStr = `${now.getHours()}:${now.getMinutes().toString().padStart(2, '0')}`;
296
  response = timeStr;
297
  }
298
 
299
- // Help - Direct answer without lecturing
300
- else if (lowerMessage.includes('help') || lowerMessage.includes('मदद')) {
301
  response = useHindi ? "बोलिए, क्या चाहिए?" : "Tell me, what do you need?";
302
  }
303
 
@@ -311,6 +303,21 @@ async function generateAIResponse(userMessage) {
311
  }
312
  }
313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
  // Failsafe for unclear inputs
315
  else {
316
  response = "थोड़ा साफ बताओ";
 
243
  const lowerMessage = userMessage.toLowerCase();
244
 
245
  // Greetings - Normal human-like
246
+ if (lowerMessage.includes('नमस्ते') || lowerMessage.includes('हैलो') || lowerMessage === 'hi' || lowerMessage === 'hello') {
247
  response = "नमस्ते!";
248
  }
 
 
 
249
  else if (lowerMessage.includes('हाल') || lowerMessage.includes('कैसे') || lowerMessage.includes('how are')) {
250
  response = useHindi ? "ठीक हूँ। आप?" : "I'm good. You?";
251
  }
252
 
253
  // Joke - Direct joke, no intro
254
+ else if (lowerMessage.includes('joke') || lowerMessage.includes('मजाक') || lowerMessage.includes('मजा')) {
255
  response = useHindi ?
256
  "डॉक्टर: आपको 1 दिन की दवा लेनी है।\nमरीज़: कब से?\nडॉक्टर: कब से क्या?" :
257
  "Doctor: Take 1 day of medicine.\nPatient: Since when?\nDoctor: Since when what?";
258
  }
259
 
260
  // Story - Immediate full story
261
+ else if (lowerMessage.includes('कहानी') || lowerMessage.includes('story') || lowerMessage.includes('कहो')) {
262
  response = useHindi ?
263
  "एक चूहा था जो रोज़ दाना बीनता। एक दिन उसे सोने का सिक्का मिला। खुश होकर उसने उसे छिपाया। दूसरे दिन चोर आया, सब ले गया। चूहे ने सीखा: अति का भला न बोले रे कोई।" :
264
  "A mouse collected grain daily. One day he found a gold coin. He hid it happily. Next day a thief came, took everything. Mouse learned: Greed brings loss.";
265
  }
266
 
267
  // Poetry - Direct poem
268
+ else if (lowerMessage.includes('कविता') || lowerMessage.includes('poem') || lowerMessage.includes('कविता सुनाओ')) {
269
  response = useHindi ?
270
  "चाँद सितारे आसमान में,\nचिड़ियाँ चहचहाती हैं,\nमन करता है उड़ जाऊँ मैं,\nइस अनंत नभ में।" :
271
  "Moon and stars in the sky,\nBirds are chirping,\nI wish to fly,\nIn this endless sky.";
272
  }
273
 
274
+ // Code - ONLY if explicitly asked "code likho" or "कोड लिखो"
275
+ else if (lowerMessage.includes('code likho') || lowerMessage.includes('कोड लिखो') || lowerMessage.includes('code बनाओ')) {
276
+ response = useHindi ? "हाँ, कौन सा code चाहिए? Python, JavaScript, HTML?" : "Yes, what code do you need?";
 
 
 
 
 
277
  }
278
 
279
  // Weather - Direct answer
280
  else if (lowerMessage.includes('मौसम') || lowerMessage.includes('weather')) {
281
+ response = useHindi ? "माफ़ी, मौसम check नहीं कर पा रहा अभी।" : "Sorry, can't check weather right now.";
282
  }
283
 
284
  // Time - Direct answer
285
+ else if (lowerMessage.includes('time') || lowerMessage.includes('समय') || lowerMessage.includes('टाइम') || lowerMessage.includes('कितना बजा')) {
286
  const now = new Date();
287
  const timeStr = `${now.getHours()}:${now.getMinutes().toString().padStart(2, '0')}`;
288
  response = timeStr;
289
  }
290
 
291
+ // Help - Direct answer
292
+ else if (lowerMessage.includes('help') || lowerMessage.includes('मदद') || lowerMessage.includes('help करो')) {
293
  response = useHindi ? "बोलिए, क्या चाहिए?" : "Tell me, what do you need?";
294
  }
295
 
 
303
  }
304
  }
305
 
306
+ // Name - Direct answer
307
+ else if (lowerMessage.includes('नाम') || lowerMessage.includes('kaun') || lowerMessage.includes('who are')) {
308
+ response = useHindi ? "मैं Desi AI Assistant हूँ। आपका AI दोस्त।" : "I'm Desi AI Assistant, your AI friend.";
309
+ }
310
+
311
+ // Age - Direct answer
312
+ else if (lowerMessage.includes('उम्र') || lowerMessage.includes('age') || lowerMessage.includes('बहुत पुराना')) {
313
+ response = useHindi ? "बस बनकर हुआ हूँ, उम्र मत पूछो।" : "Just created, don't ask age!";
314
+ }
315
+
316
+ // Where - Direct answer
317
+ else if (lowerMessage.includes('कहाँ') || lowerMessage.includes('where') || lowerMessage.includes('रहता') || lowerMessage.includes('rehta')) {
318
+ response = useHindi ? "यहीं हूँ, आपके फोन में।" : "Right here, in your phone.";
319
+ }
320
+
321
  // Failsafe for unclear inputs
322
  else {
323
  response = "थोड़ा साफ बताओ";