Skip to content

Commit

Permalink
Add Google Gemini 1.5 Pro (Preview) support via API
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDaveHello authored and sunner committed May 1, 2024
1 parent 3da2b91 commit e3b4f76
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 8 deletions.
14 changes: 8 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@kangc/v-md-editor": "^2.3.16",
"@langchain/anthropic": "^0.1.9",
"@langchain/cohere": "^0.0.7",
"@langchain/google-genai": "^0.0.7",
"@langchain/google-genai": "^0.0.12",
"@langchain/groq": "^0.0.6",
"@langchain/openai": "^0.0.12",
"@mdi/font": "^7.4.47",
Expand Down
Binary file added public/bots/gemini-1.0-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/bots/gemini-1.5-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/bots/gemini-logo.png
Binary file not shown.
11 changes: 11 additions & 0 deletions src/bots/google/Gemini15ProAPIBot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import GeminiAPIBot from "./GeminiAPIBot";

export default class Gemini15ProAPIBot extends GeminiAPIBot {
static _className = "Gemini15ProAPIBot";
static _logoFilename = "gemini-1.5-logo.png"; // Place it in public/bots/
static _model = "gemini-1.5-pro-latest";

constructor() {
super();
}
}
2 changes: 1 addition & 1 deletion src/bots/google/GeminiAPIBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
export default class GeminiAPIBot extends LangChainBot {
static _brandId = "geminiApi";
static _className = "GeminiAPIBot";
static _logoFilename = "gemini-logo.png"; // Place it in public/bots/
static _logoFilename = "gemini-1.0-logo.png"; // Place it in public/bots/
static _model = "gemini-pro";

constructor() {
Expand Down
3 changes: 3 additions & 0 deletions src/bots/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Bots
import GeminiAPIBot from "@/bots/google/GeminiAPIBot";
import Gemini15ProAPIBot from "@/bots/google/Gemini15ProAPIBot";
import ChatGPT35Bot from "@/bots/openai/ChatGPT35Bot";
import ChatGPT4Bot from "@/bots/openai/ChatGPT4Bot";
import CohereAPICommandBot from "@/bots/cohere/CohereAPICommandBot";
Expand Down Expand Up @@ -122,6 +123,7 @@ const all = [
BardBot.getInstance(),
GeminiAdvBot.getInstance(),
GeminiAPIBot.getInstance(),
Gemini15ProAPIBot.getInstance(),
Gemma2bItBot.getInstance(),
Gemma7bItBot.getInstance(),
AzureOpenAIAPIBot.getInstance(),
Expand Down Expand Up @@ -284,6 +286,7 @@ export const botTags = {
],
api: [
bots.getBotByClassName("GeminiAPIBot"),
bots.getBotByClassName("Gemini15ProAPIBot"),
bots.getBotByClassName("AzureOpenAIAPIBot"),
bots.getBotByClassName("OpenAIAPI35Bot"),
bots.getBotByClassName("OpenAIAPI3516KBot"),
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 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).",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 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)",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 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).",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 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).",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 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).",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 Pro",
"topK": "topK",
"topKPrompt": "topKの1は、モデルの語彙の中で選択されたトークンが最も確からしいことを意味します(貪欲デコードとも呼ばれます)",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 Pro",
"topK": "topK",
"topKPrompt": "topK가 1이라는 것은 선택된 토큰이 모델의 어휘 중에서 가장 가능성이 높은 것을 의미합니다 (탐욕스러운 디코딩이라고도 함).",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 Pro",
"topK": "topK",
"topKPrompt": "topK, равный 1, означает, что выбранный токен является наиболее вероятным среди всех токенов в словаре модели (это также называется жадным декодированием).",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 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)",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"geminiApi": {
"name": "Gemini API",
"gemini-pro": "Gemini-Pro",
"gemini-15-pro-latest": "Gemini 1.5 Pro",
"topK": "topK",
"topKPrompt": "topK为1意味着选定的标记在模型词汇中所有标记里是最有可能的(也称为贪婪解码)",
"topP": "topP",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/zhtw.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"bard": {
"name": "Gemini",
"gemini-pro": "Gemini",
"gemini-15-pro-latest": "Gemini 1.5 Pro",
"gemini-ultra": "Gemini 進階版"
},
"claudeApi":{
Expand Down

0 comments on commit e3b4f76

Please sign in to comment.