@recapt/mcp 0.0.31 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -3
- package/dist/tools/catalog/toolCatalog.json +25862 -67
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -421,14 +421,19 @@ async function searchBySemantic(limit, queryEmbedding) {
|
|
|
421
421
|
}
|
|
422
422
|
async function searchTools(query, limit = 5, queryEmbedding) {
|
|
423
423
|
if (queryEmbedding && queryEmbedding.length > 0) {
|
|
424
|
-
|
|
424
|
+
const results = await searchBySemantic(limit, queryEmbedding);
|
|
425
|
+
if (results.length > 0)
|
|
426
|
+
return results;
|
|
427
|
+
return searchByKeyword(query, limit);
|
|
425
428
|
}
|
|
426
429
|
try {
|
|
427
430
|
const embedding = await embedText(query);
|
|
428
|
-
|
|
431
|
+
const results = await searchBySemantic(limit, embedding);
|
|
432
|
+
if (results.length > 0)
|
|
433
|
+
return results;
|
|
429
434
|
} catch {
|
|
430
|
-
return searchByKeyword(query, limit);
|
|
431
435
|
}
|
|
436
|
+
return searchByKeyword(query, limit);
|
|
432
437
|
}
|
|
433
438
|
|
|
434
439
|
// ../../node_modules/zod-to-json-schema/dist/esm/selectParser.js
|