Mishig commited on
Commit
4e2fc92
·
unverified ·
1 Parent(s): 29ef401

[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
- return r.text();
 
 
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
  }