diff --git a/README.md b/README.md index 03df1326..19995645 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ docker pull hlohaus789/g4f - [/docs/guides/help_me](/docs/guides/help_me.md) - Join our Telegram Channel: [t.me/g4f_channel](https://telegram.me/g4f_channel) - Join our Discord Group: [discord.gg/XfybzPXPH5](https://discord.gg/XfybzPXPH5) +- Check out [G4F, but 100% local](https://github.com/gpt4free/g4f-local) ## 🔻 Site Takedown Is your site on this repository and you want to take it down? Send an email to takedown@g4f.ai with proof it is yours and it will be removed as fast as possible. To prevent reproduction please secure your API ;) diff --git a/g4f/api/__init__.py b/g4f/api/__init__.py index f8d0b4af..d8e68bed 100644 --- a/g4f/api/__init__.py +++ b/g4f/api/__init__.py @@ -85,7 +85,9 @@ class Api: if config.api_key is None and request is not None: auth_header = request.headers.get("Authorization") if auth_header is not None: - config.api_key = auth_header.split(None, 1)[-1] + auth_header = auth_header.split(None, 1)[-1] + if auth_header and auth_header != "Bearer": + config.api_key = auth_header response = self.client.chat.completions.create( **config.dict(exclude_none=True), ignored=self.list_ignored_providers diff --git a/g4f/gui/client/css/style.css b/g4f/gui/client/css/style.css index bed54f88..6ae720f3 100644 --- a/g4f/gui/client/css/style.css +++ b/g4f/gui/client/css/style.css @@ -119,7 +119,7 @@ body { width: 100%; display: flex; flex-direction: column; - gap: 15px; + gap: 5px; } .conversation #messages { @@ -129,11 +129,12 @@ body { flex-direction: column; overflow: auto; overflow-wrap: break-word; - padding-bottom: 20px; + padding-bottom: 10px; } .conversation .user-input { max-height: 200px; + margin-bottom: 10px; } .conversation .user-input input { @@ -385,12 +386,29 @@ body { font-size: 14px; } +.toolbar { + position: relative; +} + +#input-count { + width: fit-content; + font-size: 12px; + padding: 6px 15px; +} + .stop_generating, .regenerate { position: absolute; - bottom: 122px; - left: 50%; - transform: translateX(-50%); z-index: 1000000; + top: 0; + right: 0; +} + +@media only screen and (min-width: 40em) { + .stop_generating, .regenerate { + left: 50%; + transform: translateX(-50%); + right: auto; + } } .stop_generating button, .regenerate button{ @@ -399,7 +417,7 @@ body { background-color: var(--blur-bg); border-radius: var(--border-radius-1); border: 1px solid var(--blur-border); - padding: 10px 15px; + padding: 5px 15px; color: var(--colour-3); display: flex; justify-content: center; diff --git a/g4f/gui/client/html/index.html b/g4f/gui/client/html/index.html index 9ef8a820..96829b2c 100644 --- a/g4f/gui/client/html/index.html +++ b/g4f/gui/client/html/index.html @@ -112,19 +112,23 @@