feat: Add localization support for visitSpecificWebsite label
This commit adds localization support for the "visitSpecificWebsite" label in the settings.json file for multiple languages. Now, the label can be translated into different languages, including Japanese, Chinese, English, Malayalam, Italian, Portuguese, Russian, French, and Spanish.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { getWebSearchPrompt } from "~/services/ollama"
|
||||
import { webGoogleSearch } from "./search-engines/google"
|
||||
import { webDuckDuckGoSearch } from "./search-engines/duckduckgo"
|
||||
import { getSearchProvider } from "@/services/search"
|
||||
import { getIsVisitSpecificWebsite, getSearchProvider } from "@/services/search"
|
||||
import { webSogouSearch } from "./search-engines/sogou"
|
||||
import { webBraveSearch } from "./search-engines/brave"
|
||||
import { getWebsiteFromQuery, processSingleWebsite } from "./website"
|
||||
@@ -37,7 +37,9 @@ export const getSystemPromptForWeb = async (query: string) => {
|
||||
content: string;
|
||||
}[] = []
|
||||
|
||||
if (websiteVisit.hasUrl) {
|
||||
const isVisitSpecificWebsite = await getIsVisitSpecificWebsite()
|
||||
|
||||
if (isVisitSpecificWebsite && websiteVisit.hasUrl) {
|
||||
|
||||
const url = websiteVisit.url
|
||||
const queryWithoutUrl = websiteVisit.queryWithouUrls
|
||||
|
||||
@@ -10,16 +10,16 @@ import { MemoryVectorStore } from "langchain/vectorstores/memory"
|
||||
export const processSingleWebsite = async (url: string, query: string) => {
|
||||
let content = await extractReadabilityContent(url)
|
||||
|
||||
const isSimpleMode = await getIsSimpleInternetSearch()
|
||||
// const isSimpleMode = await getIsSimpleInternetSearch()
|
||||
|
||||
if (isSimpleMode) {
|
||||
return [
|
||||
{
|
||||
url,
|
||||
content: content.length > 5000 ? content.slice(0, 5000) : content
|
||||
}
|
||||
]
|
||||
}
|
||||
// if (isSimpleMode) {
|
||||
// return [
|
||||
// {
|
||||
// url,
|
||||
// content: content.length > 5000 ? content.slice(0, 5000) : content
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
|
||||
const docs: Document<Record<string, any>>[] = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user