mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 13:01:14 +03:00
Feature/Indexing (#1802)
* indexing * fix for multiple files upsert * fix default Postgres port * fix SQLite node description * add MySQLRecordManager node * fix MySQL unique index * add upsert history * update jsx ui * lint-fix * update dialog details * update llamaindex pinecone --------- Co-authored-by: chungyau97 <chungyau97@gmail.com>
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
import { FetchResponse, Index, Pinecone, ScoredPineconeRecord } from '@pinecone-database/pinecone'
|
||||
import { flatten } from 'lodash'
|
||||
import { Document as LCDocument } from 'langchain/document'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOutputsValue, INodeParams, IndexingResult } from '../../../src/Interface'
|
||||
import { flattenObject, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
|
||||
class PineconeLlamaIndex_VectorStores implements INode {
|
||||
@@ -110,7 +110,7 @@ class PineconeLlamaIndex_VectorStores implements INode {
|
||||
|
||||
//@ts-ignore
|
||||
vectorStoreMethods = {
|
||||
async upsert(nodeData: INodeData, options: ICommonObject): Promise<void> {
|
||||
async upsert(nodeData: INodeData, options: ICommonObject): Promise<Partial<IndexingResult>> {
|
||||
const indexName = nodeData.inputs?.pineconeIndex as string
|
||||
const pineconeNamespace = nodeData.inputs?.pineconeNamespace as string
|
||||
const docs = nodeData.inputs?.document as LCDocument[]
|
||||
@@ -144,6 +144,7 @@ class PineconeLlamaIndex_VectorStores implements INode {
|
||||
|
||||
try {
|
||||
await VectorStoreIndex.fromDocuments(llamadocs, { serviceContext, storageContext })
|
||||
return { numAdded: finalDocs.length, addedDocs: finalDocs }
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user