Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support multipart/form-data format request #1690

Merged
merged 3 commits into from
Sep 22, 2024

Conversation

bearslyricattack
Copy link
Contributor

@bearslyricattack bearslyricattack commented Jul 24, 2024

close #1655

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

c121914yu
c121914yu previously approved these changes Jul 24, 2024
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

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

Please upload report for BASE (main@254b977). Learn more about missing BASE report.

Files with missing lines Patch % Lines
common/gin.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             main   #1690   +/-   ##
======================================
  Coverage        ?   1.27%           
======================================
  Files           ?     145           
  Lines           ?   10379           
  Branches        ?       0           
======================================
  Hits            ?     132           
  Misses          ?   10233           
  Partials        ?      14           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bearslyricattack
Copy link
Contributor Author

没看懂啥意思 需要怎么做

就是这个问题的出现是代码本身的问题 原先的代码不能解析multipart/form-data类型的数据 现在可以解析了 使用最新版代码构建就不会有这个问题了

@bearslyricattack
Copy link
Contributor Author

另外 升级后就可以对接第三方语音模型了吗  config和oneapi如何配置对接其他语音模型

---Original--- From: @.> Date: Wed, Jul 24, 2024 22:16 PM To: @.>; Cc: @.@.>; Subject: Re: [songquanpeng/one-api] "add parser multipart/form-data" (PR#1690) 没看懂啥意思 需要怎么做 就是这个问题的出现是代码本身的问题 原先的代码不能解析multipart/form-data类型的数据 现在可以解析了 使用最新版代码构建就不会有这个问题了 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

这个应该还是不行 这次就解决这一个问题

common/gin.go Outdated
type ModelRequest struct {
Model string `json:"model" form:"model"`
}

func UnmarshalBodyReusable(c *gin.Context, v any) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么不直接使用ShouldBind,可以直接判断请求类型来去解析,这里解析成ModelRequest再转成json再由json解析成传入参数,没有必要。

@songquanpeng songquanpeng changed the title "add parser multipart/form-data" feat: support multipart/form-data format request Sep 22, 2024
@songquanpeng songquanpeng merged commit fdd7bf4 into songquanpeng:main Sep 22, 2024
1 of 2 checks passed
@songquanpeng
Copy link
Owner

Thx~

@William-715
Copy link

image
容器升级到最新版本,还是存在去找whisper-1模型,我实际配置的是: whisper-large-v3模型

@William-715
Copy link

引起whisper-1问题的部分代码更新是还没合并到 v0.6.9-alpha.2容器版本里面吗?

1 similar comment
@wfce
Copy link

wfce commented Oct 13, 2024

引起whisper-1问题的部分代码更新是还没合并到 v0.6.9-alpha.2容器版本里面吗?

@wfce
Copy link

wfce commented Oct 13, 2024

Thx~

引起whisper-1问题的部分代码更新是还没合并到 v0.6.9-alpha.2容器版本里面吗?

mxdlzg pushed a commit to mxdlzg/one-api that referenced this pull request Oct 15, 2024
* "add parser multipart/form-data"

* chore: fix impl

* chore: update impl

---------

Co-authored-by: JustSong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

whisper 模型渠道选择问题
6 participants