fix: 搜图工具增加yandex

This commit is contained in:
ikechan8370 2025-02-15 19:14:17 +08:00
parent 2ad77d8112
commit 9f521064a1

View file

@ -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'
}