incognitolm commited on
Commit ·
173f635
1
Parent(s): 4975320
Update chatStream.js
Browse files- server/chatStream.js +1 -1
server/chatStream.js
CHANGED
|
@@ -30,7 +30,7 @@ async function gradioSearch(query) {
|
|
| 30 |
body: JSON.stringify({ query }),
|
| 31 |
});
|
| 32 |
const res = await req.json();
|
| 33 |
-
if (!req.ok || !res.
|
| 34 |
throw new Error(`Search API error: ${res.error || req.statusText}`);
|
| 35 |
}
|
| 36 |
return res.results[0];
|
|
|
|
| 30 |
body: JSON.stringify({ query }),
|
| 31 |
});
|
| 32 |
const res = await req.json();
|
| 33 |
+
if (!req.ok || !res.results) {
|
| 34 |
throw new Error(`Search API error: ${res.error || req.statusText}`);
|
| 35 |
}
|
| 36 |
return res.results[0];
|