summaryrefslogtreecommitdiffstats
path: root/g4f/gui/client
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-26 12:49:52 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-26 12:49:52 +0100
commit1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b (patch)
tree845e5d27d9f94c16215da60aaee0ad36f5a35344 /g4f/gui/client
parentNew minimum requirements (#1515) (diff)
downloadgpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.gz
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.bz2
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.lz
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.xz
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.tar.zst
gpt4free-1eb7dc05e59433de149ec16d9b2fe19b3fa4b24b.zip
Diffstat (limited to '')
-rw-r--r--g4f/gui/client/js/chat.v1.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/g4f/gui/client/js/chat.v1.js b/g4f/gui/client/js/chat.v1.js
index d62c040b..99a75569 100644
--- a/g4f/gui/client/js/chat.v1.js
+++ b/g4f/gui/client/js/chat.v1.js
@@ -164,12 +164,16 @@ const ask_gpt = async () => {
for (const line of value.split("\n")) {
if (!line) continue;
const message = JSON.parse(line);
- if (message["type"] == "content") {
- text += message["content"];
+ if (message.type == "content") {
+ text += message.content;
} else if (message["type"] == "provider") {
- provider = message["provider"];
- content.querySelector('.provider').innerHTML =
- '<a href="' + provider.url + '" target="_blank">' + provider.name + "</a>"
+ provider = message.provider
+ content.querySelector('.provider').innerHTML = `
+ <a href="${provider.url}" target="_blank">
+ ${provider.name}
+ </a>
+ ${provider.model ? ' with ' + provider.model : ''}
+ `
} else if (message["type"] == "error") {
error = message["error"];
} else if (message["type"] == "message") {