diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-01-27 16:09:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-27 16:09:21 +0100 |
commit | 0d83bdeef91001c7c00d69f79fccad5a78b4b94b (patch) | |
tree | 362ebeb245cc4e123914635b03f890a314a7a40d /g4f/gui/client/js | |
parent | Merge pull request #1512 from KennyPhan123/patch-1 (diff) | |
parent | Fix PerplexityLabs Provider, Improve bypass_cloudflare helper (diff) | |
download | gpt4free-0d83bdeef91001c7c00d69f79fccad5a78b4b94b.tar gpt4free-0d83bdeef91001c7c00d69f79fccad5a78b4b94b.tar.gz gpt4free-0d83bdeef91001c7c00d69f79fccad5a78b4b94b.tar.bz2 gpt4free-0d83bdeef91001c7c00d69f79fccad5a78b4b94b.tar.lz gpt4free-0d83bdeef91001c7c00d69f79fccad5a78b4b94b.tar.xz gpt4free-0d83bdeef91001c7c00d69f79fccad5a78b4b94b.tar.zst gpt4free-0d83bdeef91001c7c00d69f79fccad5a78b4b94b.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/gui/client/js/chat.v1.js | 14 |
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") { |