From 9f521064a12adb2c615b83404db8975fe7b6f42a Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Sat, 15 Feb 2025 19:14:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=90=9C=E5=9B=BE=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0yandex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/tools/SearchImageTool.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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' }