File tree 2 files changed +10
-12
lines changed
2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -828,12 +828,12 @@ export class PGLiteDatabaseAdapter
828
828
SELECT
829
829
embedding,
830
830
COALESCE(
831
- content->$2->>$3 ,
831
+ content->>$2 ,
832
832
''
833
833
) as content_text
834
834
FROM memories
835
- WHERE type = $4
836
- AND content->$2->>$3 IS NOT NULL
835
+ WHERE type = $3
836
+ AND content->>$2 IS NOT NULL
837
837
)
838
838
SELECT
839
839
embedding,
@@ -845,17 +845,16 @@ export class PGLiteDatabaseAdapter
845
845
WHERE levenshtein(
846
846
$1,
847
847
content_text
848
- ) <= $6 -- Add threshold check
848
+ ) <= $5 -- Add threshold check
849
849
ORDER BY levenshtein_score
850
- LIMIT $5
850
+ LIMIT $4
851
851
` ;
852
852
853
853
const { rows } = await this . query < {
854
854
embedding : number [ ] ;
855
855
levenshtein_score : number ;
856
856
} > ( sql , [
857
857
opts . query_input ,
858
- opts . query_field_name ,
859
858
opts . query_field_sub_name ,
860
859
opts . query_table_name ,
861
860
opts . query_match_count ,
Original file line number Diff line number Diff line change @@ -1016,12 +1016,12 @@ export class PostgresDatabaseAdapter
1016
1016
SELECT
1017
1017
embedding,
1018
1018
COALESCE(
1019
- content->$2->>$3 ,
1019
+ content->>$2 ,
1020
1020
''
1021
1021
) as content_text
1022
1022
FROM memories
1023
- WHERE type = $4
1024
- AND content->$2->>$3 IS NOT NULL
1023
+ WHERE type = $3
1024
+ AND content->>$2 IS NOT NULL
1025
1025
)
1026
1026
SELECT
1027
1027
embedding,
@@ -1033,14 +1033,13 @@ export class PostgresDatabaseAdapter
1033
1033
WHERE levenshtein(
1034
1034
$1,
1035
1035
content_text
1036
- ) <= $6 -- Add threshold check
1036
+ ) <= $5 -- Add threshold check
1037
1037
ORDER BY levenshtein_score
1038
- LIMIT $5
1038
+ LIMIT $4
1039
1039
` ;
1040
1040
1041
1041
const { rows } = await this . pool . query ( sql , [
1042
1042
opts . query_input ,
1043
- opts . query_field_name ,
1044
1043
opts . query_field_sub_name ,
1045
1044
opts . query_table_name ,
1046
1045
opts . query_match_count ,
You can’t perform that action at this time.
0 commit comments