diff options
Diffstat (limited to '')
-rw-r--r-- | g4f/gui/client/static/js/chat.v1.js | 5 | ||||
-rw-r--r-- | g4f/gui/server/api.py | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js index 46f7e808..8933b442 100644 --- a/g4f/gui/client/static/js/chat.v1.js +++ b/g4f/gui/client/static/js/chat.v1.js @@ -1026,9 +1026,10 @@ async function on_api() { }); providers = await api("providers") - providers.forEach((provider) => { + Object.entries(providers).forEach(([provider, label]) => { let option = document.createElement("option"); - option.value = option.text = provider; + option.value = provider; + option.text = label; providerSelect.appendChild(option); }) diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py index bbae6066..d8c3aaf8 100644 --- a/g4f/gui/server/api.py +++ b/g4f/gui/server/api.py @@ -43,7 +43,16 @@ class Api(): """ Return a list of all working providers. """ - return [provider.__name__ for provider in __providers__ if provider.working] + return { + provider.__name__: (provider.label + if hasattr(provider, "label") + else provider.__name__) + + (" (WebDriver)" + if "webdriver" in provider.get_parameters() + else "") + for provider in __providers__ + if provider.working + } def get_version(self): """ |