From d8fd1ed93689d8417110388ef65e9d77c21bd968 Mon Sep 17 00:00:00 2001 From: Adrien Date: Wed, 22 May 2024 09:35:02 +0200 Subject: [PATCH] Put keys in the more menu --- Chat.go | 14 ++++- views/chat.html | 2 +- views/partials/popover-models.html | 17 +++--- views/partials/popover-settings.html | 87 ++++++++++++++++++++++++++-- 4 files changed, 104 insertions(+), 16 deletions(-) diff --git a/Chat.go b/Chat.go index d944083..e041aa6 100644 --- a/Chat.go +++ b/Chat.go @@ -444,7 +444,19 @@ func LoadSettingsHandler(c *fiber.Ctx) error { if !checkIfLogin() { return c.SendString("") } - out, err := pongo2.Must(pongo2.FromFile("views/partials/popover-settings.html")).Execute(pongo2.Context{"IsLogin": checkIfLogin()}) + + openaiExists, anthropicExists, mistralExists, groqExists, gooseaiExists, googleExists := getExistingKeys() + + out, err := pongo2.Must(pongo2.FromFile("views/partials/popover-settings.html")).Execute(pongo2.Context{ + "IsLogin": checkIfLogin(), + "OpenaiExists": openaiExists, + "AnthropicExists": anthropicExists, + "MistralExists": mistralExists, + "GroqExists": groqExists, + "GooseaiExists": gooseaiExists, + "GoogleExists": googleExists, + "AnyExists": openaiExists || anthropicExists || mistralExists || groqExists || gooseaiExists || googleExists, + }) if err != nil { panic(err) } diff --git a/views/chat.html b/views/chat.html index 82797ce..6b491f5 100644 --- a/views/chat.html +++ b/views/chat.html @@ -8,7 +8,7 @@ id="chat-input-textarea">
- +