Update dependencies and fix whitespace formatting in isTTSEnabled function in tts.ts

This commit is contained in:
n4ze3m
2024-04-15 11:32:30 +05:30
parent 476323d928
commit c914233610
11 changed files with 302 additions and 115 deletions

View File

@@ -59,24 +59,24 @@ export class PageAssistHtmlLoader
]
}
let html = this.html
// let html = this.html
if (isWikipedia(this.url)) {
console.log("Wikipedia URL detected")
html = parseWikipedia(html)
}
// else if (isTwitter(this.url)) {
// console.log("Twitter URL detected")
// html = parseTweet(html, this.url)
// if (isWikipedia(this.url)) {
// console.log("Wikipedia URL detected")
// html = parseWikipedia(html)
// }
const htmlCompiler = compile({
wordwrap: false
})
const text = htmlCompiler(html)
// // else if (isTwitter(this.url)) {
// // console.log("Twitter URL detected")
// // html = parseTweet(html, this.url)
// // }
// const htmlCompiler = compile({
// wordwrap: false
// })
// const text = htmlCompiler(html)
const metadata = { source: this.url }
return [new Document({ pageContent: text, metadata })]
return [new Document({ pageContent: this.html, metadata })]
}
async loadByURL(): Promise<Document<Record<string, any>>[]> {
@@ -110,7 +110,7 @@ export class PageAssistHtmlLoader
console.log("Wikipedia URL detected")
html = parseWikipedia(await fetchHTML.text())
}
// else if (isTwitter(this.url)) {
// console.log("Twitter URL detected")
// html = parseTweet(await fetchHTML.text(), this.url)