feat: Add vector search to SearXNG search provider
chore: remove unnecessary type annotation in web.ts
This commit is contained in:
parent
5687517238
commit
0226de7c39
@ -80,7 +80,16 @@ export const searxngSearch = async (query: string) => {
|
||||
const store = new MemoryVectorStore(ollamaEmbedding)
|
||||
await store.addDocuments(chunks)
|
||||
|
||||
return store
|
||||
const resultsWithEmbeddings = await store.similaritySearch(query, 3)
|
||||
|
||||
const searchResult = resultsWithEmbeddings.map((result) => {
|
||||
return {
|
||||
url: result.metadata.url,
|
||||
content: result.pageContent
|
||||
}
|
||||
})
|
||||
|
||||
return searchResult
|
||||
}
|
||||
|
||||
const searxngJSONSearch = async (baseURL: string, query: string) => {
|
||||
|
@ -50,7 +50,6 @@ export const getSystemPromptForWeb = async (query: string) => {
|
||||
|
||||
} else {
|
||||
const searchProvider = await getSearchProvider()
|
||||
//@ts-ignore
|
||||
search = await searchWeb(searchProvider, query)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user