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

chore: rename Gemini to Gemini API to prevent naming conflicts #775

Merged
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
chore: rename Gemini to Gemini API to prevent naming conflicts
  • Loading branch information
PeterDaveHello committed Apr 1, 2024
commit e4460742cd8dd8617233d2b82d987bf52b74cba9
18 changes: 9 additions & 9 deletions src/bots/google/GeminiBot.js → src/bots/google/GeminiAPIBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import LangChainBot from "@/bots/LangChainBot";
import store from "@/store";
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";

export default class GeminiBot extends LangChainBot {
static _brandId = "gemini";
static _className = "GeminiBot";
export default class GeminiAPIBot extends LangChainBot {
static _brandId = "geminiApi";
static _className = "GeminiAPIBot";
static _logoFilename = "gemini-logo.png"; // Place it in public/bots/
static _model = "gemini-pro";

Expand All @@ -15,25 +15,25 @@ export default class GeminiBot extends LangChainBot {
async _checkAvailability() {
let available = false;

if (store.state.gemini.apiKey) {
if (store.state.geminiApi.apiKey) {
this.setupModel();
available = true;
}
return available;
}

getPastRounds() {
return store.state.gemini.pastRounds;
return store.state.geminiApi.pastRounds;
}

_setupModel() {
const chatModel = new ChatGoogleGenerativeAI({
apiKey: store.state.gemini.apiKey,
apiKey: store.state.geminiApi.apiKey,
modelName: this.constructor._model ? this.constructor._model : "",
temperature: store.state.gemini.temperature,
temperature: store.state.geminiApi.temperature,
streaming: true,
topK: store.state.gemini.topK,
topP: store.state.gemini.topP,
topK: store.state.geminiApi.topK,
topP: store.state.geminiApi.topP,
});
return chatModel;
}
Expand Down
6 changes: 3 additions & 3 deletions src/bots/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bots
import GeminiBot from "@/bots/google/GeminiBot";
import GeminiAPIBot from "@/bots/google/GeminiAPIBot";
import ChatGPT35Bot from "@/bots/openai/ChatGPT35Bot";
import ChatGPT4Bot from "@/bots/openai/ChatGPT4Bot";
import ChatGPTBrowsingBot from "@/bots/openai/ChatGPTBrowsingBot";
Expand Down Expand Up @@ -108,7 +108,7 @@ const all = [
FalconHC180bBot.getInstance(),
BardBot.getInstance(),
GeminiAdvBot.getInstance(),
GeminiBot.getInstance(),
GeminiAPIBot.getInstance(),
Gemma2bItBot.getInstance(),
Gemma7bItBot.getInstance(),
AzureOpenAIAPIBot.getInstance(),
Expand Down Expand Up @@ -266,7 +266,7 @@ export const botTags = {
bots.getBotByClassName("Claude3OpusBot"),
],
api: [
bots.getBotByClassName("GeminiBot"),
bots.getBotByClassName("GeminiAPIBot"),
bots.getBotByClassName("AzureOpenAIAPIBot"),
bots.getBotByClassName("OpenAIAPI35Bot"),
bots.getBotByClassName("OpenAIAPI3516KBot"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</template>

<script>
import Bot from "@/bots/google/GeminiBot";
import Bot from "@/bots/google/GeminiAPIBot";
import CommonBotSettings from "@/components/BotSettings/CommonBotSettings.vue";
import { Type } from "./settings.const";

Expand Down Expand Up @@ -36,17 +36,17 @@ const settings = [
{
type: Type.Slider,
name: "topK",
title: "gemini.topK",
description: "gemini.topKPrompt",
title: "geminiApi.topK",
description: "geminiApi.topKPrompt",
min: 1,
max: 100,
step: 1,
},
{
type: Type.Slider,
name: "topP",
title: "gemini.topP",
description: "gemini.topPPrompt",
title: "geminiApi.topP",
description: "geminiApi.topPPrompt",
min: 0.1,
max: 1,
step: 0.01,
Expand Down
4 changes: 2 additions & 2 deletions src/components/SettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ import CommonBotSettings from "@/components/BotSettings/CommonBotSettings.vue";

import ChatGPTBotSettings from "@/components/BotSettings/ChatGPTBotSettings.vue";
import OpenAIAPIBotSettings from "@/components/BotSettings/OpenAIAPIBotSettings.vue";
import GeminiBotSettings from "@/components/BotSettings/GeminiBotSettings.vue";
import GeminiAPIBotSettings from "@/components/BotSettings/GeminiAPIBotSettings.vue";
import AzureOpenAIAPIBotSettings from "./BotSettings/AzureOpenAIAPIBotSettings.vue";
import BingChatBotSettings from "@/components/BotSettings/BingChatBotSettings.vue";
import SparkBotSettings from "./BotSettings/SparkBotSettings.vue";
Expand Down Expand Up @@ -154,7 +154,7 @@ const botSettings = [
{ brand: "lmsys", component: LMSYSBotSettings },
{ brand: "moss", component: MOSSBotSettings },
{ brand: "openaiApi", component: OpenAIAPIBotSettings },
{ brand: "gemini", component: GeminiBotSettings },
{ brand: "geminiApi", component: GeminiAPIBotSettings },
{ brand: "openAssistant", component: OpenAssistantBotSettings },
{ brand: "phind", component: PhindBotSettings },
{ brand: "pi", component: PiBotSettings },
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"gpt-4": "GPT-4"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "Ein topK von 1 bedeutet, dass das ausgewählte Token das wahrscheinlichste unter allen Token im Vokabular des Modells ist (auch gieriges Decodieren genannt).",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"gpt-4-mobile": "GPT-4 Mobile V2"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "A topK of 1 means the selected token is the most probable among all the tokens in the model's vocabulary (also called greedy decoding)",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"gpt-4-mobile": "GPT-4 móvil V2"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "Un topK de 1 significa que el token seleccionado es el más probable entre todos los tokens en el vocabulario del modelo (también llamado decodificación voraz).",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"gpt-4-browsing": "Navigation Web"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "Un topK de 1 signifie que le jeton sélectionné est le plus probable parmi tous les jetons dans le vocabulaire du modèle (également appelé décodage gourmand).",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"gpt-4-browsing": "Navigazione Web"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "Un topK di 1 significa che il token selezionato è il più probabile tra tutti i token nel vocabolario del modello (chiamato anche decodifica avida).",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"gpt-4-mobile": "GPT-4 モバイル V2"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "topKの1は、モデルの語彙の中で選択されたトークンが最も確からしいことを意味します(貪欲デコードとも呼ばれます)",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"gpt-4-mobile": "GPT-4 모바일 V2"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "topK가 1이라는 것은 선택된 토큰이 모델의 어휘 중에서 가장 가능성이 높은 것을 의미합니다 (탐욕스러운 디코딩이라고도 함).",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"gpt-4": "GPT-4"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "topK, равный 1, означает, что выбранный токен является наиболее вероятным среди всех токенов в словаре модели (это также называется жадным декодированием).",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"gpt-4-mobile": "GPT-4 Mobile V2"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "Một topK của 1 có nghĩa là token được chọn là có khả năng cao nhất trong tất cả các token trong từ vựng của mô hình (còn được gọi là giải mã tham lam)",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"gpt-4-mobile": "GPT-4 移动版V2"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "topK为1意味着选定的标记在模型词汇中所有标记里是最有可能的(也称为贪婪解码)",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/zhtw.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"gpt-4-mobile": "GPT-4 行動裝置版 V2"
},
"gemini": {
"name": "Gemini",
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"topK": "topK",
"topKPrompt": "topK為1表示選定的標記是模型詞彙中所有標記中最可能的(也稱為貪婪解碼)",
Expand Down
6 changes: 3 additions & 3 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default createStore({
uuid: "",
lang: "auto",
columns: 2,
gemini: {
geminiApi: {
apiKey: "",
temperature: 0.7,
pastRounds: 5,
Expand Down Expand Up @@ -188,8 +188,8 @@ export default createStore({
setChatgpt(state, refreshCycle) {
state.chatgpt.refreshCycle = refreshCycle;
},
setGemini(state, values) {
state.gemini = { ...state.gemini, ...values };
setGeminiApi(state, values) {
state.geminiApi = { ...state.geminiApi, ...values };
},
setOpenaiApi(state, values) {
state.openaiApi = { ...state.openaiApi, ...values };
Expand Down