summaryrefslogtreecommitdiffstats
path: root/g4f/gui/client/static
diff options
context:
space:
mode:
authorTekky <98614666+xtekky@users.noreply.github.com>2024-10-30 09:54:54 +0100
committerGitHub <noreply@github.com>2024-10-30 09:54:54 +0100
commit1c8061af5550a150b1319d04275771698b226cec (patch)
tree489d5d84e812bd9ba3e2c88c2322b45f016c766d /g4f/gui/client/static
parentre-include`AsyncClient` for backwards compatibility, with deprecationwarning. Use `Client` instead (diff)
parentUpdate (docs/async_client.md docs/client.md docs/interference-api.md g4f/client/client.py) (diff)
downloadgpt4free-1c8061af5550a150b1319d04275771698b226cec.tar
gpt4free-1c8061af5550a150b1319d04275771698b226cec.tar.gz
gpt4free-1c8061af5550a150b1319d04275771698b226cec.tar.bz2
gpt4free-1c8061af5550a150b1319d04275771698b226cec.tar.lz
gpt4free-1c8061af5550a150b1319d04275771698b226cec.tar.xz
gpt4free-1c8061af5550a150b1319d04275771698b226cec.tar.zst
gpt4free-1c8061af5550a150b1319d04275771698b226cec.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)