chore: Update logic of runtime url rewrite

This commit is contained in:
n4ze3m
2024-05-12 21:14:27 +05:30
parent bd84b90e5f
commit 62ffe8346e
11 changed files with 148 additions and 38 deletions

View File

@@ -7,7 +7,7 @@ import type { Document } from "@langchain/core/documents"
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"
import { MemoryVectorStore } from "langchain/vectorstores/memory"
import { cleanUrl } from "~/libs/clean-url"
import { chromeRunTime } from "~/libs/runtime"
import { urlRewriteRuntime } from "~/libs/runtime"
import { PageAssistHtmlLoader } from "~/loader/html"
import {
defaultEmbeddingChunkOverlap,
@@ -18,7 +18,7 @@ import {
export const localGoogleSearch = async (query: string) => {
await chromeRunTime(
await urlRewriteRuntime(
cleanUrl("https://www.google.com/search?hl=en&q=" + query)
)
const abortController = new AbortController()