File tree 1 file changed +11
-1
lines changed
packages/adapter-pglite/src
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1349,6 +1349,16 @@ export class PGLiteDatabaseAdapter
1349
1349
searchText ?: string ;
1350
1350
} ) : Promise < RAGKnowledgeItem [ ] > {
1351
1351
return this . withDatabase ( async ( ) => {
1352
+ interface KnowledgeSearchRow {
1353
+ id : UUID ;
1354
+ agentId : UUID ;
1355
+ content : string ;
1356
+ embedding : Buffer | null ;
1357
+ createdAt : string | number ;
1358
+ vector_score : number ;
1359
+ keyword_score : number ;
1360
+ combined_score : number ;
1361
+ }
1352
1362
try {
1353
1363
const cacheKey = `embedding_${ params . agentId } _${ params . searchText } ` ;
1354
1364
const cachedResult = await this . getCache ( {
@@ -1400,7 +1410,7 @@ export class PGLiteDatabaseAdapter
1400
1410
LIMIT $5
1401
1411
` ;
1402
1412
1403
- const { rows } = await this . query < RAGKnowledgeItem > ( sql , [
1413
+ const { rows } = await this . query < KnowledgeSearchRow > ( sql , [
1404
1414
vectorStr ,
1405
1415
params . agentId ,
1406
1416
`%${ params . searchText || "" } %` ,
You can’t perform that action at this time.
0 commit comments