From f724c07f1b8cb1b2360d8c6675688b15cbcd85ca Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Fri, 12 Apr 2024 20:58:40 +0200 Subject: Add labels to provider list --- g4f/gui/server/api.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'g4f/gui/server') 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): """ -- cgit v1.2.3