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: reset image num to 1 when not given #821

Merged
merged 2 commits into from
Dec 17, 2023

Conversation

ye4293
Copy link
Contributor

@ye4293 ye4293 commented Dec 14, 2023

close #811
be2c3906e189aff0870bd0f401d77e6
对于官方文档,当没有设置参数n时,会默认为1。有些应用的请求没有默认n=1,会导致报错
我已确认该 PR 已自测通过,相关截图如下:

@ccyuvin
Copy link

ccyuvin commented Dec 15, 2023

看官网文档,dall-e-2也是可选。只是对于dall-e-3 模型,n只能传1

@ShinChven
Copy link
Contributor

#775

我这里改了一下直接跳过 azure 渠道 dalle 请求中的这个参数判断。不知道会不会跟你的 PR 冲突。

@songquanpeng
Copy link
Owner

改了一下,现在如果没给值的话直接设置为 1

@songquanpeng songquanpeng changed the title Update relay-image.go 修改了对于dalle3模型请求时,没有设置参数n的情况,使其默认为1 feat: reset image num to 1 when not given Dec 17, 2023
@songquanpeng songquanpeng merged commit 66f06e5 into songquanpeng:main Dec 17, 2023
H0llyW00dzZ pushed a commit to H0llyW00dzZ/one-api that referenced this pull request Dec 20, 2023
* Update relay-image.go

* fix: reset image num to 1 when not given

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
H0llyW00dzZ added a commit to H0llyW00dzZ/one-api that referenced this pull request Dec 20, 2023
* feat: add Google Gemini Pro support (songquanpeng#826)

* fest: Add Google Gemini Pro, fix songquanpeng#810

* fest: Add tooling to Gemini; Add OpenAI-like system prompt to Gemini

* refactor: removing unused if statement

* fest: Add dummy model message for system message in gemini model

* chore: update implementation

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>

* fix: fix Gemini stream problem

* fix: fix xunfei panic error (close songquanpeng#820)

* fix: try to return a more meaningful error message (close songquanpeng#817)

* feat: reset image num to 1 when not given (songquanpeng#821)

* Update relay-image.go

* fix: reset image num to 1 when not given

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>

* feat: able to set sqlite busy_timeout (songquanpeng#818)

* add sqlite busy_timeout=3000

* chore: update impl

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>

* feat: update ali relay implementation (songquanpeng#830)

* 修改通译千问最新接口:1.删除history参数,改用官方推荐的messages参数 2.整理messages参数顺序,补充必要上下文信息 3.用autogen调试测试通过

* chore: update impl

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>

* feat: add condition to validate n value for non-Azure channels (songquanpeng#775)

- Add a condition to validate the n value only for non-Azure channels, ensuring it falls within the acceptable range.
- Fix Azure compatibility

* docs: update readme

* docs: update readme

* fix: fix gemini panic (close songquanpeng#833)

* fix: fix max_tokens check

---------

Co-authored-by: David Zhuang <i@dz.ax>
Co-authored-by: JustSong <songquanpeng@foxmail.com>
Co-authored-by: Ghostz <137054651+ye4293@users.noreply.github.com>
Co-authored-by: Calcium-Ion <61247483+Calcium-Ion@users.noreply.github.com>
Co-authored-by: Oliver Lee <ol_l@msn.cn>
Co-authored-by: ShinChven ✨ <shinchven@gmail.com>
dirname pushed a commit to dirname/one-api that referenced this pull request Dec 22, 2023
* Update relay-image.go

* fix: reset image num to 1 when not given

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
greeeds pushed a commit to greeeds/one-api that referenced this pull request Mar 3, 2024
* Update relay-image.go

* fix: reset image num to 1 when not given

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
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.

POST /v1/images/generations 缺少参数n就请求报错400
4 participants