mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: 啊
This commit is contained in:
parent
19f9c804bb
commit
8c7e6489e7
2 changed files with 6 additions and 5 deletions
|
|
@ -26,14 +26,14 @@ export class ProcessPictureTool extends AbstractTool {
|
|||
description = 'useful when you want to know what is inside a photo, such as user\'s avatar or other pictures'
|
||||
|
||||
func = async function (opts) {
|
||||
let { imgUrl, qq, type } = opts
|
||||
let { url, qq, type } = opts
|
||||
if (qq) {
|
||||
imgUrl = `https://q1.qlogo.cn/g?b=qq&s=160&nk=${qq}`
|
||||
url = `https://q1.qlogo.cn/g?b=qq&s=160&nk=${qq}`
|
||||
}
|
||||
if (!imgUrl) {
|
||||
if (!url) {
|
||||
return 'you must give at least one parameter of imgUrl and qq'
|
||||
}
|
||||
const imageResponse = await fetch(imgUrl)
|
||||
const imageResponse = await fetch(url)
|
||||
const blob = await imageResponse.blob()
|
||||
const arrayBuffer = await blob.arrayBuffer()
|
||||
const buffer = Buffer.from(arrayBuffer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue