NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

GEMINI-pro 希望支持one-api

Open kuziTony opened this issue 2 years ago • 6 comments

如果输入模型gemini-pro会自动识别为google的模型,在后端部署了one-api被转化成了标准的openai的接口,期望可以自定义模型的时候输入模型名称,自定义选择是google或者是openai或者是微软。

kuziTony avatar Jan 08 '24 15:01 kuziTony

Bot detected the issue body's language is not English, translate it automatically.


Title: GEMINI-pro hopes to support one-api

If you enter the model gemini-pro will automatically recognize it as a Google model. One-api is deployed on the backend and converted into a standard openai interface. If you want to customize the model, enter the model name. The custom choice is google or openai or Microsoft.

Issues-translate-bot avatar Jan 08 '24 15:01 Issues-translate-bot

currently it's still not supported yet to be honest its hard for front-end, unlike in back-end so easy even I was made this hahaha

https://github.com/H0llyW00dzZ/GoGenAI-Terminal-Chat

H0llyW00dzZ avatar Jan 08 '24 16:01 H0llyW00dzZ

只能先参照这个issue用吧。https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/issues/3693

iamsad3508 avatar Jan 09 '24 07:01 iamsad3508

Bot detected the issue body's language is not English, translate it automatically.


You can only refer to this issue first. https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/issues/3693

Issues-translate-bot avatar Jan 09 '24 07:01 Issues-translate-bot

currently it's still not supported yet to be honest its hard for front-end, unlike in back-end so easy even I was made this hahaha

https://github.com/H0llyW00dzZ/GoGenAI-Terminal-Chat

Regarding this issue, I have a suggestion that users should be allowed to set the communication type for the model. When users add a model through CUSTOM_MODEL, they can add the type setting by using #(or other identifier), such as model#type, gemini-pro#OpenAI. If not added, it defaults to the OpenAI endpoint.

QAbot-zh avatar Jan 31 '24 12:01 QAbot-zh

改一下api.ts文件就行, 两个地方

  1. 下面这里的判断注释掉 constructor(provider: ModelProvider = ModelProvider.GPT) { // if (provider === ModelProvider.GeminiPro) { // this.llm = new GeminiProApi(); // return; // } this.llm = new ChatGPTApi(); }
  2. 下面isGoogle直接赋值false // const isGoogle = modelConfig.model.startsWith("gemini"); const isGoogle = false; image

poweroc avatar Apr 02 '24 08:04 poweroc