File tree 1 file changed +25
-1
lines changed
packages/components/nodes/vectorstores/Postgres
1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,26 @@ import { PGVectorDriver } from './driver/PGVector'
13
13
14
14
const serverCredentialsExists = ! ! process . env . POSTGRES_VECTORSTORE_USER && ! ! process . env . POSTGRES_VECTORSTORE_PASSWORD
15
15
16
+ // added temporarily to fix the base class return for VectorStore when postgres node is using TypeORM
17
+ function getVectorStoreBaseClasses ( ) {
18
+ // Try getting base classes through the utility function
19
+ const baseClasses = getBaseClasses ( VectorStore )
20
+
21
+ // If we got results, return them
22
+ if ( baseClasses && baseClasses . length > 0 ) {
23
+ return baseClasses
24
+ }
25
+
26
+ // If VectorStore is recognized as a class but getBaseClasses returned nothing,
27
+ // return the known inheritance chain
28
+ if ( VectorStore instanceof Function ) {
29
+ return [ 'VectorStore' ]
30
+ }
31
+
32
+ // Fallback to minimum required class
33
+ return [ 'VectorStore' ]
34
+ }
35
+
16
36
class Postgres_VectorStores implements INode {
17
37
label : string
18
38
name : string
@@ -188,7 +208,11 @@ class Postgres_VectorStores implements INode {
188
208
{
189
209
label : 'Postgres Vector Store' ,
190
210
name : 'vectorStore' ,
191
- baseClasses : [ this . type , ...getBaseClasses ( VectorStore ) ]
211
+ baseClasses : [
212
+ this . type ,
213
+ // ...getBaseClasses(VectorStore), // disabled temporarily for using TypeORM
214
+ ...getVectorStoreBaseClasses ( ) // added temporarily for using TypeORM
215
+ ]
192
216
}
193
217
]
194
218
}
You can’t perform that action at this time.
0 commit comments