one-api icon indicating copy to clipboard operation
one-api copied to clipboard

feat: support openai images edits api

Open Laisky opened this issue 9 months ago • 11 comments

说明

支持 OpenAI 的 ImagesEdits 接口

https://platform.openai.com/docs/api-reference/images/createEdit

这个接口比较特殊的地方在于接受的是 FORM 而不是 JSON。

自测

我已确认该 PR 已自测通过,相关截图如下:

CleanShot 2024-04-25 at 11 10 50@2x

Laisky avatar Apr 25 '24 03:04 Laisky

nb

ye4293 avatar Apr 25 '24 04:04 ye4293

周末处理~

songquanpeng avatar Apr 25 '24 16:04 songquanpeng

实用效果图,支持这个接口是为之后即将推出的 dall-e-3 inpaiting 作准备。

https://github.com/songquanpeng/one-api/assets/4532436/cf04d390-e2cc-46dd-a6b2-44725bf7ea30

Laisky avatar Apr 28 '24 02:04 Laisky

这个功能是不是还没提交到最新版,试了一下不行。

popdo avatar May 07 '24 07:05 popdo

这个功能是不是还没提交到最新版,试了一下不行。

尚未合并,目前只能用我的 fork 试。

Laisky avatar May 07 '24 07:05 Laisky

不好意思拖了这么久,我尽量抽时间处理

songquanpeng avatar May 27 '24 17:05 songquanpeng

不好意思拖了这么久,我尽量抽时间处理

一个人太吃力了,不考虑把这个项目转成 ORG 然后搞个委员会来处理 PR 吗?

Laisky avatar May 28 '24 03:05 Laisky

很有道理,我确实力不从心

songquanpeng avatar Jun 18 '24 16:06 songquanpeng

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Project coverage is 1.30%. Comparing base (c936198) to head (c44928b).

Files Patch % Lines
relay/adaptor/openai/image.go 0.00% 8 Missing :warning:
common/gin.go 0.00% 5 Missing :warning:
relay/adaptor/openai/adaptor.go 0.00% 2 Missing :warning:
relay/controller/image.go 0.00% 2 Missing :warning:
relay/relaymode/helper.go 0.00% 2 Missing :warning:
controller/relay.go 0.00% 1 Missing :warning:
middleware/distributor.go 0.00% 1 Missing :warning:
relay/adaptor/common.go 0.00% 1 Missing :warning:
router/relay.go 0.00% 1 Missing :warning:
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1369      +/-   ##
========================================
- Coverage   1.30%   1.30%   -0.01%     
========================================
  Files        144     144              
  Lines      10140   10151      +11     
========================================
  Hits         132     132              
- Misses      9994   10005      +11     
  Partials      14      14              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jul 13 '24 13:07 codecov[bot]

@songquanpeng 冲突都修好了,可以看看还要合吗

Laisky avatar Jul 24 '24 02:07 Laisky

希望合并。

ReberMusk avatar Sep 28 '24 12:09 ReberMusk