summaryrefslogtreecommitdiffstats
path: root/g4f/gui/client/static/js/chat.v1.js
diff options
context:
space:
mode:
authorTekky <98614666+xtekky@users.noreply.github.com>2024-10-30 09:57:55 +0100
committerTekky <98614666+xtekky@users.noreply.github.com>2024-10-30 09:57:55 +0100
commit1443c60cc86f7f02cc6c7a4b2a31d6b1dad66a26 (patch)
tree435d831df4ad5c18839cfaa647f23e5be035cdd6 /g4f/gui/client/static/js/chat.v1.js
parentimplement direct import of `Client` without using `g4f.client` (diff)
parentMerge pull request #2304 from kqlio67/main (diff)
downloadgpt4free-1443c60cc86f7f02cc6c7a4b2a31d6b1dad66a26.tar
gpt4free-1443c60cc86f7f02cc6c7a4b2a31d6b1dad66a26.tar.gz
gpt4free-1443c60cc86f7f02cc6c7a4b2a31d6b1dad66a26.tar.bz2
gpt4free-1443c60cc86f7f02cc6c7a4b2a31d6b1dad66a26.tar.lz
gpt4free-1443c60cc86f7f02cc6c7a4b2a31d6b1dad66a26.tar.xz
gpt4free-1443c60cc86f7f02cc6c7a4b2a31d6b1dad66a26.tar.zst
gpt4free-1443c60cc86f7f02cc6c7a4b2a31d6b1dad66a26.zip
Diffstat (limited to '')
-rw-r--r--g4f/gui/client/static/js/chat.v1.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js
index d5a1ffaa..42ddb129 100644
--- a/g4f/gui/client/static/js/chat.v1.js
+++ b/g4f/gui/client/static/js/chat.v1.js
@@ -338,6 +338,14 @@ const prepare_messages = (messages, message_index = -1) => {
messages = messages.filter((_, index) => message_index >= index);
}
+ let new_messages = [];
+ if (systemPrompt?.value) {
+ new_messages.push({
+ "role": "system",
+ "content": systemPrompt.value
+ });
+ }
+
// Remove history, if it's selected
if (document.getElementById('history')?.checked) {
if (message_index == null) {
@@ -347,13 +355,6 @@ const prepare_messages = (messages, message_index = -1) => {
}
}
- let new_messages = [];
- if (systemPrompt?.value) {
- new_messages.push({
- "role": "system",
- "content": systemPrompt.value
- });
- }
messages.forEach((new_message) => {
// Include only not regenerated messages
if (new_message && !new_message.regenerate) {
@@ -366,6 +367,7 @@ const prepare_messages = (messages, message_index = -1) => {
return new_messages;
}
+
async function add_message_chunk(message) {
if (message.type == "conversation") {
console.info("Conversation used:", message.conversation)