diff --git a/utils/tools/SearchImageTool.js b/utils/tools/SearchImageTool.js index d929d4f..78d2998 100644 --- a/utils/tools/SearchImageTool.js +++ b/utils/tools/SearchImageTool.js @@ -12,14 +12,18 @@ export class SerpImageTool extends AbstractTool { limit: { type: 'number', description: 'image number' + }, + source: { + type: 'string', + description: 'search source, bing or yandex' } }, required: ['q'] } func = async function (opts) { - let { q, limit = 2 } = opts - let serpRes = await fetch(`https://serp.ikechan8370.com/image/bing?q=${encodeURIComponent(q)}&limit=${limit}`, { + let { q, limit = 2, source = 'bing' } = opts + let serpRes = await fetch(`https://serp.ikechan8370.com/${source}/bing?q=${encodeURIComponent(q)}&limit=${limit}`, { headers: { 'X-From-Library': 'ikechan8370' }