Spaces:
Runtime error
Runtime error
Mishig
commited on
[fix] Assistant websearch text/markdown source (#1129)
Browse files
src/lib/server/websearch/parseWeb.ts
CHANGED
|
@@ -32,7 +32,9 @@ export async function parseWeb(url: string) {
|
|
| 32 |
r.headers.get("content-type")?.includes("text/plain") ||
|
| 33 |
r.headers.get("content-type")?.includes("text/markdown")
|
| 34 |
) {
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
} else {
|
| 37 |
throw new Error("Unsupported content type");
|
| 38 |
}
|
|
|
|
| 32 |
r.headers.get("content-type")?.includes("text/plain") ||
|
| 33 |
r.headers.get("content-type")?.includes("text/markdown")
|
| 34 |
) {
|
| 35 |
+
const text = await r.text();
|
| 36 |
+
// JSON.stringify is needed to turn string concatenation into a single string (ex: "Hello, " + "world!" -> "Hello, world!")
|
| 37 |
+
return JSON.stringify(text);
|
| 38 |
} else {
|
| 39 |
throw new Error("Unsupported content type");
|
| 40 |
}
|