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: 支持 Google Gemini Pro 模型 #636

Merged
merged 4 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@
- HuggingChat, 由[插件](https://github.com/RockChinQ/revLibs)接入, 仅支持英文
- Claude, 由[插件](https://github.com/RockChinQ/revLibs)接入
- Google Bard, 由[插件](https://github.com/RockChinQ/revLibs)接入
- Google Gemini Pro、Azure、Anthropic Claude、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑等官方接口, 通过[One API](https://github.com/songquanpeng/one-api)接入

### 模型聚合平台

- [One API](https://github.com/songquanpeng/one-api), Azure、Anthropic Claude、Google PaLM 2、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问以及 360 智脑等模型的官方接口转换成 OpenAI API 接入,QChatGPT 原生支持,您需要先配置 One API,之后在`config.py`中设置反向代理和`One API`的密钥后使用。
- [One API](https://github.com/songquanpeng/one-api), Azure、Anthropic Claude、Google Gemini Pro、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问以及 360 智脑等模型的官方接口转换成 OpenAI API 接入,QChatGPT 原生支持,您需要先配置 One API,之后在`config.py`中设置反向代理和`One API`的密钥后使用。
- [gpt4free](https://github.com/xtekky/gpt4free), 破解以免费使用多个平台的各种文字模型, 由[插件](https://github.com/RockChinQ/revLibs)接入, 无需鉴权, 稳定性较差。
- [Poe](https://poe.com), 破解免费使用Poe上多个平台的模型, 由[oliverkirk-sudo/ChatPoeBot](https://github.com/oliverkirk-sudo/ChatPoeBot)接入(由于 Poe 上可用的大部分模型现已通过[revLibs插件](https://github.com/RockChinQ/revLubs)或其他方式接入,此插件现已停止维护)。

Expand Down
1 change: 1 addition & 0 deletions config-template.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
# "qwen-plus-v1",
# "ERNIE-Bot",
# "ERNIE-Bot-turbo",
# "gemini-pro",
completion_api_params = {
"model": "gpt-3.5-turbo",
"temperature": 0.9, # 数值越低得到的回答越理性,取值范围[0, 1]
Expand Down
2 changes: 2 additions & 0 deletions pkg/openai/modelmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"qwen-plus-v1",
"ERNIE-Bot",
"ERNIE-Bot-turbo",
"gemini-pro",
}

EDIT_MODELS = {
Expand Down Expand Up @@ -90,6 +91,7 @@ def count_chat_completion_tokens(messages: list, model: str) -> int:
"qwen-plus-v1",
"ERNIE-Bot",
"ERNIE-Bot-turbo",
"gemini-pro",
}:
tokens_per_message = 3
tokens_per_name = 1
Expand Down
Loading