Spaces:
Running
Running
MaduRox commited on
Commit ·
beabdf0
1
Parent(s): 124f5a3
feat: deploy Kalpana RIF O(1) Studio with Needle-in-a-Haystack benchmarks, layer architecture, and Swagger API
Browse files
app.js
CHANGED
|
@@ -149,9 +149,9 @@ async function handleUserChat() {
|
|
| 149 |
} else {
|
| 150 |
try {
|
| 151 |
const clean = prompt
|
| 152 |
-
.replace(/^(who is|who was|what is|what was|what are|explain|tell me about|how does|why is the|why is|why)\
|
| 153 |
.replace(/diayana/i, 'diana')
|
| 154 |
-
.replace(/\
|
| 155 |
.trim();
|
| 156 |
|
| 157 |
const sRes = await fetch(`https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=${encodeURIComponent(clean)}&utf8=&format=json&origin=*`);
|
|
|
|
| 149 |
} else {
|
| 150 |
try {
|
| 151 |
const clean = prompt
|
| 152 |
+
.replace(/^(who is|who was|what is|what was|what are|explain|tell me about|how does|why is the|why is|why)\s+/i, '')
|
| 153 |
.replace(/diayana/i, 'diana')
|
| 154 |
+
.replace(/\?+$/, '')
|
| 155 |
.trim();
|
| 156 |
|
| 157 |
const sRes = await fetch(`https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=${encodeURIComponent(clean)}&utf8=&format=json&origin=*`);
|