-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Conversation
Codecov ReportAttention: Patch coverage is
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. |
就是这个问题的出现是代码本身的问题 原先的代码不能解析multipart/form-data类型的数据 现在可以解析了 使用最新版代码构建就不会有这个问题了 |
这个应该还是不行 这次就解决这一个问题 |
common/gin.go
Outdated
type ModelRequest struct { | ||
Model string `json:"model" form:"model"` | ||
} | ||
|
||
func UnmarshalBodyReusable(c *gin.Context, v any) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么不直接使用ShouldBind,可以直接判断请求类型来去解析,这里解析成ModelRequest再转成json再由json解析成传入参数,没有必要。
Thx~ |
引起whisper-1问题的部分代码更新是还没合并到 v0.6.9-alpha.2容器版本里面吗? |
1 similar comment
引起whisper-1问题的部分代码更新是还没合并到 v0.6.9-alpha.2容器版本里面吗? |
引起whisper-1问题的部分代码更新是还没合并到 v0.6.9-alpha.2容器版本里面吗? |
* "add parser multipart/form-data" * chore: fix impl * chore: update impl --------- Co-authored-by: JustSong <[email protected]>
* fix: Groq organization not auto-disabled when blocked (songquanpeng#1822) * fix: postgres use COALESCE replace null (songquanpeng#1793) Co-authored-by: jinqi.guo <[email protected]> * feat: update disabled channel (songquanpeng#1780) * Update disabled channel * Update manage.go * Update manage.go * chore: add missing space --------- Co-authored-by: JustSong <[email protected]> Co-authored-by: JustSong <[email protected]> * feat: ResponseFormat support json_schema (songquanpeng#1759) * feat: responseFormat support json_schema * chore: rename struct name --------- Co-authored-by: JustSong <[email protected]> * fix: fix ali embedding model always use v1 (songquanpeng#1747) * fix:ali embedding model: v2 and v3 * chore: use ctxkey.RequestModel to eliminate hardcoding --------- Co-authored-by: xuejia <[email protected]> Co-authored-by: JustSong <[email protected]> * feat: update stepfun models (songquanpeng#1740) Co-authored-by: chenlinfeng <[email protected]> * feat: add lobechat open link options (songquanpeng#1741) Co-authored-by: Star <[email protected]> * fix: getTokenById return token nil, make panic (songquanpeng#1728) * fix:getTokenById return token nil, make panic * chore: remove useless err check --------- Co-authored-by: JustSong <[email protected]> * feat: support new openai models (4o 0806, chatgpt-4o-latest) (songquanpeng#1721) * feat: support new model gpt-4o-2024-08-06 * feat: support new model chatgpt-4o-latest * feat: add oidc support (songquanpeng#1725) * feat: add the ui for configuring the third-party standard OAuth2.0/OIDC. - update SystemSetting.js - add setup ui - add configuration * feat: add the ui for "allow the OAuth 2.0 to login" - update SystemSetting.js * feat: add OAuth 2.0 web ui and its process functions - update common.js - update AuthLogin.js - update config.js * fix: missing "Userinfo" endpoint configuration entry, used by OAuth clients to request user information from the IdP. - update config.js - update SystemSetting.js * feat: updated the icons for Lark and OIDC to match the style of the icons for WeChat, EMail, GitHub. - update lark.svg - new oidc.svg * refactor: Changing OAuth 2.0 to OIDC * feat: add OIDC login method * feat: Add support for OIDC login to the backend * fix: Change the AppId and AppSecret on the Web UI to the standard usage: ClientId, ClientSecret. * feat: Support quick configuration of OIDC through Well-Known Discovery Endpoint * feat: Standardize terminology, add well-known configuration - Change the AppId and AppSecret on the Server End to the standard usage: ClientId, ClientSecret. - add Well-Known configuration to store in database, no actual use in server end but store and display in web ui only * feat: support SparkDesk-v3.1-128K (songquanpeng#1732) * feat: 支持SparkDesk-v3.1-128K以及hunyuan-vision * feat: 支持SparkDesk-v3.1-128K以及hunyuan-vision --------- Co-authored-by: lihangfu <[email protected]> * feat: add siliconflow usage (songquanpeng#1798) * fix: return the usage info if not null (songquanpeng#1792) Usage is missing. * fix: modify the type of token models to be text (songquanpeng#1761) * fix: modify the type of token models to be text * chore: update receiver name --------- Co-authored-by: JustSong <[email protected]> * feat: support multipart/form-data format request (songquanpeng#1690) * "add parser multipart/form-data" * chore: fix impl * chore: update impl --------- Co-authored-by: JustSong <[email protected]> * feat: support SparkDesk-v3.5-32K (songquanpeng#1832) Co-authored-by: lihangfu <[email protected]> * fix:unsuccessful lobechat redirection link (songquanpeng#1843) * feat: add Vertex AI gemini-1.5-pro-002 and gemini-1.5-flash-002 (songquanpeng#1854) * fix: use modelMap when testing a channel (songquanpeng#1855) Co-authored-by: oliang <[email protected]> * feat: update groq model and price (songquanpeng#1864) * feat: add support for Claude Sonnet 3.5 v2 (songquanpeng#1888) * feat: update Gemini adaptor to support custom response format (songquanpeng#1892) * feat: always return usage in stream mode * feat: able to hide test model selector and balance col * feat: added support for Claude 3.5 Haiku (songquanpeng#1912) * feat: add support for xAI (songquanpeng#1915) * feat: add new claude models (songquanpeng#1910) * feat: Add new models to ModelList in constants.go * feat: update model lists and mappings for Claude 3.5 versions --------- Co-authored-by: JustSong <[email protected]> * fix: changeoptional field to pointer type (songquanpeng#1907) * fix:修复在渠道配置中设置模型重定向时,temperature为0被忽略的问题 * fix: set optional fields to pointer type --------- Co-authored-by: JustSong <[email protected]> * feat: update GeneralOpenAIRequest * fix: update Spark Lite's domain to lite (songquanpeng#1896) * feat: able to use ENFORCE_INCLUDE_USAGE to enforce include usage in response * feat: support set system prompt for channel (close songquanpeng#1920) * feat: support set system_prompt for theme air & berry * feat: add warning in log when system prompt is reset * feat: support gzip decode (songquanpeng#1962) * feat: update feishu oauth login * docs: update readme * feat: support replicate chat models (songquanpeng#1989) * feat: add Replicate adaptor and integrate into channel and API types * feat: support llm chat on replicate * feat: add support for new OpenAI models and update billing ratios (songquanpeng#1990) * feat: add gemini-2.0-flash-exp and fix race condition in processChannelRelayError (songquanpeng#1983) Co-authored-by: JustSong <[email protected]> * chore(deps): bump golang.org/x/crypto from 0.24.0 to 0.31.0 (songquanpeng#1976) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.24.0 to 0.31.0. - [Commits](golang/crypto@v0.24.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: update qwen model and price (songquanpeng#1966) * feat: enhance response handling to support gemini-2.0-thinking (songquanpeng#1995) * fix: fix balance query for siliconflow (songquanpeng#1960) * docs: add tutorial section for BT Panel installation (songquanpeng#1985) * Update README.md 在国内有大部分用户都在使用宝塔面板管理服务器,因此增加使用宝塔面板部署的教程,可视化的部署方式可以帮助用户更加便捷的部署one-api * docs: update readme --------- Co-authored-by: JustSong <[email protected]> * fix: remove the duplicate `claude-3-5-haiku-20241022` in Anthropic's base model list (songquanpeng#1957) * Update constants.go Remove the duplicate `claude-3-5-haiku-20241022` causing issue 1928 * fix: fix syntax error --------- Co-authored-by: JustSong <[email protected]> * feat: support Redis Sentinel and Redis Cluster (songquanpeng#1952) * feature: support Redis Sentinel and Redis Cluster * chore: update implementation --------- Co-authored-by: JustSong <[email protected]> * feat: add balance query support for DeepSeek (songquanpeng#1946) * Support Balance Query for DeepSeek * Fix * chore: update model mapping implementation for audio (songquanpeng#1932) * fixed model mapping * chore: update implementation --------- Co-authored-by: JustSong <[email protected]> * feat: support gpt-4o-2024-11-20 (songquanpeng#1941) * fix: add branch limitation and drop pull_request trigger for ci.yml * fix: add branch check * docs: update README.md * chore: update readme * chore: update ci yaml * new disable * fix --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: AJ's Life Journey <[email protected]> Co-authored-by: guogeer <[email protected]> Co-authored-by: jinqi.guo <[email protected]> Co-authored-by: Ghostz <[email protected]> Co-authored-by: JustSong <[email protected]> Co-authored-by: JustSong <[email protected]> Co-authored-by: majian <[email protected]> Co-authored-by: leavegee <[email protected]> Co-authored-by: xuejia <[email protected]> Co-authored-by: forrestlinfeng <[email protected]> Co-authored-by: chenlinfeng <[email protected]> Co-authored-by: 千寻简 <[email protected]> Co-authored-by: Star <[email protected]> Co-authored-by: qinguoyi <[email protected]> Co-authored-by: TAKO <[email protected]> Co-authored-by: OnEvent <[email protected]> Co-authored-by: lihangfu <[email protected]> Co-authored-by: lihangfu <[email protected]> Co-authored-by: TimeTrapzz <[email protected]> Co-authored-by: byte911 <[email protected]> Co-authored-by: 徐瑞东 <[email protected]> Co-authored-by: 抒情熊 <[email protected]> Co-authored-by: Pan, Wen-Ming <[email protected]> Co-authored-by: liangjs <[email protected]> Co-authored-by: oliang <[email protected]> Co-authored-by: longkeyy <[email protected]> Co-authored-by: shaoyun <[email protected]> Co-authored-by: Wei Tingjiang <[email protected]> Co-authored-by: Ryo Shen <[email protected]> Co-authored-by: Laisky.Cai <[email protected]> Co-authored-by: wanthigh <[email protected]> Co-authored-by: Calcium-Ion <[email protected]> Co-authored-by: JustSong <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ke Wang <[email protected]> Co-authored-by: bestlaw66 <[email protected]> Co-authored-by: ZhangTianrong <[email protected]> Co-authored-by: Yuwei Ba <[email protected]> Co-authored-by: Qiying Wang <[email protected]> Co-authored-by: liuliming <[email protected]>
close #1655
我已确认该 PR 已自测通过,相关截图如下: