summaryrefslogtreecommitdiffstats
path: root/g4f/gui
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-20 20:12:36 +0200
committerGitHub <noreply@github.com>2024-04-20 20:12:36 +0200
commitda81d1e51aa5c625e4107bf8148cdb3c778f4001 (patch)
tree01b7677bfd51667e6b8bebe0ac72921aa48cba58 /g4f/gui
parentMerge pull request #1862 from hlohaus/nem (diff)
parentDisable Bing integration test (diff)
downloadgpt4free-0.3.0.2.tar
gpt4free-0.3.0.2.tar.gz
gpt4free-0.3.0.2.tar.bz2
gpt4free-0.3.0.2.tar.lz
gpt4free-0.3.0.2.tar.xz
gpt4free-0.3.0.2.tar.zst
gpt4free-0.3.0.2.zip
Diffstat (limited to 'g4f/gui')
-rw-r--r--g4f/gui/client/static/css/style.css2
-rw-r--r--g4f/gui/client/static/js/chat.v1.js5
-rw-r--r--g4f/gui/server/api.py2
3 files changed, 5 insertions, 4 deletions
diff --git a/g4f/gui/client/static/css/style.css b/g4f/gui/client/static/css/style.css
index c0279bc2..a28c9cd6 100644
--- a/g4f/gui/client/static/css/style.css
+++ b/g4f/gui/client/static/css/style.css
@@ -890,7 +890,7 @@ a:-webkit-any-link {
resize: vertical;
max-height: 200px;
- min-height: 80px;
+ min-height: 100px;
}
/* style for hljs copy */
diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js
index 39027260..a043cb25 100644
--- a/g4f/gui/client/static/js/chat.v1.js
+++ b/g4f/gui/client/static/js/chat.v1.js
@@ -302,7 +302,7 @@ async function add_message_chunk(message) {
window.provider_result = message.provider;
content.querySelector('.provider').innerHTML = `
<a href="${message.provider.url}" target="_blank">
- ${message.provider.name}
+ ${message.provider.label ? message.provider.label : message.provider.name}
</a>
${message.provider.model ? ' with ' + message.provider.model : ''}
`
@@ -545,7 +545,8 @@ const load_conversation = async (conversation_id, scroll=true) => {
last_model = item.provider?.model;
let next_i = parseInt(i) + 1;
let next_provider = item.provider ? item.provider : (messages.length > next_i ? messages[next_i].provider : null);
- let provider_link = item.provider?.name ? `<a href="${item.provider.url}" target="_blank">${item.provider.name}</a>` : "";
+ let provider_label = item.provider?.label ? item.provider?.label : item.provider?.name;
+ let provider_link = item.provider?.name ? `<a href="${item.provider.url}" target="_blank">${provider_label}</a>` : "";
let provider = provider_link ? `
<div class="provider">
${provider_link}
diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py
index e3244c84..211d40c6 100644
--- a/g4f/gui/server/api.py
+++ b/g4f/gui/server/api.py
@@ -99,7 +99,7 @@ class Api():
if api_key is not None:
kwargs["api_key"] = api_key
if json_data.get('web_search'):
- if provider == "Bing":
+ if provider in ("Bing", "HuggingChat"):
kwargs['web_search'] = True
else:
from .internet import get_search_message