ChatGPTNextWeb / ChatGPTNextWeb/NextChat

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

Open
#5,384 5 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted planned
Dominant language
TypeScript
Stars
88.8k
Forks
59.1k
PR merge metrics
No merged PRs in 30d

Description

### 🥰 需求描述

上传的图片可以通过插件上传到图床
![Screenshot_2024-09-07-23-59-38-678_mark via](https://github.com/user-attachments/assets/535d1dd6-d637-4acc-aa0c-d38a2f82e345)

### 🧐 解决方案

同上

### 📝 补充信息

插件
> 这个图床上传接口通过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": {}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.