diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-02-26 10:59:18 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-02-26 10:59:18 +0100 |
commit | 02b84fb519c853cee0a7765b475371d9eb59cf60 (patch) | |
tree | 3035374d3110f0a9d09a6aa59a7043076dc90a0a /g4f/gui | |
parent | Fix GeminiPro auth for normal user (diff) | |
download | gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.gz gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.bz2 gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.lz gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.xz gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.tar.zst gpt4free-02b84fb519c853cee0a7765b475371d9eb59cf60.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/gui/client/html/index.html | 1 | ||||
-rw-r--r-- | g4f/gui/client/js/chat.v1.js | 19 |
2 files changed, 15 insertions, 5 deletions
diff --git a/g4f/gui/client/html/index.html b/g4f/gui/client/html/index.html index 102a762e..9ef8a820 100644 --- a/g4f/gui/client/html/index.html +++ b/g4f/gui/client/html/index.html @@ -173,7 +173,6 @@ <option value="">Provider: Auto</option> <option value="Bing">Bing</option> <option value="OpenaiChat">OpenaiChat</option> - <option value="HuggingChat">HuggingChat</option> <option value="Gemini">Gemini</option> <option value="Liaobots">Liaobots</option> <option value="Phind">Phind</option> diff --git a/g4f/gui/client/js/chat.v1.js b/g4f/gui/client/js/chat.v1.js index c727dbf9..edd27689 100644 --- a/g4f/gui/client/js/chat.v1.js +++ b/g4f/gui/client/js/chat.v1.js @@ -121,6 +121,20 @@ const remove_cancel_button = async () => { }; const filter_messages = (messages) => { + // Removes none user messages at end + let last_message; + while (last_message = new_messages.pop()) { + if (last_message["role"] == "user") { + new_messages.push(last_message); + break; + } + } + + // Remove history, if it is selected + if (document.getElementById('history')?.checked) { + messages = [messages[messages.length-1]]; + } + let new_messages = []; for (i in messages) { new_message = messages[i]; @@ -135,6 +149,7 @@ const filter_messages = (messages) => { new_messages.push(new_message) } } + return new_messages; } @@ -143,10 +158,6 @@ const ask_gpt = async () => { messages = await get_messages(window.conversation_id); total_messages = messages.length; - // Remove history, if it is selected - if (document.getElementById('history')?.checked) { - messages = [messages[messages.length-1]]; - } messages = filter_messages(messages); window.scrollTo(0, 0); |