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: add Google Gemini Pro support #826

Merged
merged 5 commits into from
Dec 17, 2023
Merged

Conversation

cnbeining
Copy link
Contributor

fix #810

image

image

image

image

choice.FinishReason = &stopFinishReason
var response ChatCompletionsStreamResponse
response.Object = "chat.completion.chunk"
response.Model = "gemini"
Copy link

Choose a reason for hiding this comment

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

gemini-pro

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gemini Ultra 未来复用代码即可

Copy link
Contributor Author

Choose a reason for hiding this comment

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

怀疑 Gemini Ultra 的URL应该会是 https://generativelanguage.googleapis.com/v1beta/models/gemini-ultra:generateContent,所以这里不写死pro.

controller/relay-gemini-chat.go Outdated Show resolved Hide resolved
@songquanpeng
Copy link
Owner

现在开始处理该 PR

@songquanpeng songquanpeng changed the title fest: Add Google Gemini Pro, fix #810 feat: addGoogle Gemini Pro support Dec 17, 2023
@songquanpeng songquanpeng changed the title feat: addGoogle Gemini Pro support feat: add Google Gemini Pro support Dec 17, 2023
@songquanpeng songquanpeng merged commit 5cf23d8 into songquanpeng:main Dec 17, 2023
@songquanpeng
Copy link
Owner

Thx~

H0llyW00dzZ pushed a commit to H0llyW00dzZ/one-api that referenced this pull request Dec 20, 2023
* 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 <[email protected]>
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 <[email protected]>

* 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 <[email protected]>

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

* add sqlite busy_timeout=3000

* chore: update impl

---------

Co-authored-by: JustSong <[email protected]>

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

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

* chore: update impl

---------

Co-authored-by: JustSong <[email protected]>

* 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 <[email protected]>
Co-authored-by: JustSong <[email protected]>
Co-authored-by: Ghostz <[email protected]>
Co-authored-by: Calcium-Ion <[email protected]>
Co-authored-by: Oliver Lee <[email protected]>
Co-authored-by: ShinChven ✨ <[email protected]>
dirname pushed a commit to dirname/one-api that referenced this pull request Dec 22, 2023
* 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 <[email protected]>
greeeds pushed a commit to greeeds/one-api that referenced this pull request Mar 3, 2024
* 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 <[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.

可以支持谷歌的gemini吗
3 participants