mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: 搜图工具增加yandex
This commit is contained in:
parent
2ad77d8112
commit
9f521064a1
1 changed files with 6 additions and 2 deletions
|
|
@ -12,14 +12,18 @@ export class SerpImageTool extends AbstractTool {
|
||||||
limit: {
|
limit: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
description: 'image number'
|
description: 'image number'
|
||||||
|
},
|
||||||
|
source: {
|
||||||
|
type: 'string',
|
||||||
|
description: 'search source, bing or yandex'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: ['q']
|
required: ['q']
|
||||||
}
|
}
|
||||||
|
|
||||||
func = async function (opts) {
|
func = async function (opts) {
|
||||||
let { q, limit = 2 } = opts
|
let { q, limit = 2, source = 'bing' } = opts
|
||||||
let serpRes = await fetch(`https://serp.ikechan8370.com/image/bing?q=${encodeURIComponent(q)}&limit=${limit}`, {
|
let serpRes = await fetch(`https://serp.ikechan8370.com/${source}/bing?q=${encodeURIComponent(q)}&limit=${limit}`, {
|
||||||
headers: {
|
headers: {
|
||||||
'X-From-Library': 'ikechan8370'
|
'X-From-Library': 'ikechan8370'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue