ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
76.45k stars 59.12k forks source link

[Feature Request] 能实现把图片上传到插件中的图床的功能吗 #5384

Open holzora opened 2 months ago

holzora commented 2 months ago

🥰 需求描述

上传的图片可以通过插件上传到图床 Screenshot_2024-09-07-23-59-38-678_mark via

🧐 解决方案

同上

📝 补充信息

插件

这个图床上传接口通过cf代理,访问速度不太理想,所以想通过搭建的nextchat机子中转

{
"openapi": "3.1.0",
"info": {
"title": "Image Upload API",
"description": "A simple API to upload images and convert them.",
"version": "v1.0.0"
},
"servers": [
{
"url": "https://img.kksk.io"
}
],
"paths": {
"/image/post": {
"post": {
"operationId": "uploadImage",
"description": "Uploads an image, converts it to webp format, and checks compliance.",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary",
"description": "The image file to upload."
}
},
"required": ["file"]
}
}
}
},
"responses": {
"200": {
"description": "Image uploaded successfully or non-compliant.",
"content": {
"application/json": {
"schema": {
type: "object",
properties: {
status: { type: "integer" },
msg: { type: "string" },
data: {
type: "object",
properties: {
curl: { type: "string", description: "Converted image URL" },
purl: { type: "string", description: "Original image URL" }
}
}
}
}
}
}
},
"400": {
"description": "Bad request, no files uploaded or invalid file type.",
"content": {
"application/json": {
"schema": {
type: "object",
properties: {
status: { type: "integer" },
msg: { type: "string" }
}
}
}
}
},
"500": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
type: "object",
properties: {
status: { type: "integer" },
msg: { type: "string" }
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {}
}
}
Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Feature Request] Can the function of uploading pictures to the picture bed in the plug-in be realized?

lloydzhou commented 2 months ago

现在的Plugin还不支持调用接口的时候,使用formdata的格式提交数据(自然也不支持提交file)

原因在于,这里的参数是由LLM提供的。LLM并不能成功的构造出一个formdata格式数据。

后续,可能会尝试给出一个固定的语法(可能类似curl 中 -F file=@/somepath/file.ext这种)再由plugin runtime去支持

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


The current Plugin does not support submitting data in the formdata format when calling the interface (naturally, it does not support submitting files).

The reason is that the parameters here are provided by LLM. LLM cannot successfully construct a formdata format data.

In the future, we may try to give a fixed syntax (perhaps similar to -F file=@/somepath/file.ext in curl) and then support it by the plugin runtime.

holzora commented 2 months ago

现在的Plugin还不支持调用接口的时候,使用formdata的格式提交数据(自然也不支持提交file)

原因在于,这里的参数是由LLM提供的。LLM并不能成功的构造出一个formdata格式数据。

后续,可能会尝试给出一个固定的语法(可能类似curl 中 -F file=@/somepath/file.ext这种)再由plugin runtime去支持

好的,辛苦了🙏🏻

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


The current Plugin does not support using the formdata format to submit data when calling the interface (naturally, it does not support submitting files)

The reason is that the parameters here are provided by LLM. LLM cannot successfully construct a formdata format data.

In the future, we may try to give a fixed syntax (perhaps similar to -F file=@/somepath/file.ext in curl) and then support it by the plugin runtime

Okay, thank you for your hard work🙏🏻