mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
[mob] Allow injecting score threshold in query
This commit is contained in:
parent
b7acd3033d
commit
0c20be98d7
@ -144,6 +144,14 @@ class SemanticSearchService {
|
||||
String query, {
|
||||
double? scoreThreshold,
|
||||
}) async {
|
||||
// if the query starts with 0.xxx, the split the query to get score threshold and actual query
|
||||
if (query.startsWith(RegExp(r"0\.\d+"))) {
|
||||
final parts = query.split(" ");
|
||||
if (parts.length > 1) {
|
||||
scoreThreshold = double.parse(parts[0]);
|
||||
query = parts.sublist(1).join(" ");
|
||||
}
|
||||
}
|
||||
final textEmbedding = await _getTextEmbedding(query);
|
||||
|
||||
final queryResults = await _getSimilarities(
|
||||
|
Loading…
x
Reference in New Issue
Block a user