From 07063b0fd83dc7bb76b095015042a97a2ccff330 Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Sat, 23 Sep 2023 01:29:55 +0100 Subject: =?UTF-8?q?~=20|=C2=A0Update=20models=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/readme_table.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'tool') diff --git a/tool/readme_table.py b/tool/readme_table.py index 9e43b0ae..4351c036 100644 --- a/tool/readme_table.py +++ b/tool/readme_table.py @@ -8,6 +8,7 @@ sys.path.append(str(Path(__file__).parent.parent)) import asyncio from g4f import models from g4f.Provider.base_provider import AsyncProvider, BaseProvider +from g4f.Provider.retry_provider import RetryProvider from testing.test_providers import get_providers logging = False @@ -20,6 +21,7 @@ def print_imports(): for _provider in get_providers(): if _provider.working: print(f" {_provider.__name__},") + print(")") print("# Usage:") print("response = g4f.ChatCompletion.create(..., provider=ProviderName)") @@ -72,26 +74,30 @@ def print_providers(): ] providers = get_providers() - responses = asyncio.run(test_async_list(providers)) + #responses = asyncio.run(test_async_list(providers)) for is_working in (True, False): for idx, _provider in enumerate(providers): if is_working != _provider.working: continue + if _provider == RetryProvider: + continue + netloc = urlparse(_provider.url).netloc website = f"[{netloc}]({_provider.url})" - provider_name = f"g4f.provider.{_provider.__name__}" + provider_name = f"`g4f.Provider.{_provider.__name__}`" has_gpt_35 = "✔️" if _provider.supports_gpt_35_turbo else "❌" has_gpt_4 = "✔️" if _provider.supports_gpt_4 else "❌" stream = "✔️" if _provider.supports_stream else "❌" can_async = "✔️" if issubclass(_provider, AsyncProvider) else "❌" if _provider.working: - if responses[idx]: - status = '![Active](https://img.shields.io/badge/Active-brightgreen)' - else: - status = '![Unknown](https://img.shields.io/badge/Unknown-grey)' + status = '![Active](https://img.shields.io/badge/Active-brightgreen)' + # if responses[idx]: + # status = '![Active](https://img.shields.io/badge/Active-brightgreen)' + # else: + # status = '![Unknown](https://img.shields.io/badge/Unknown-grey)' else: status = '![Inactive](https://img.shields.io/badge/Inactive-red)' auth = "✔️" if _provider.needs_auth else "❌" @@ -145,8 +151,8 @@ def get_models(): if __name__ == "__main__": - print_imports() - print_async() + # print_imports() + # print_async() print_providers() - print("\n", "-" * 50, "\n") - print_models() \ No newline at end of file + # print("\n", "-" * 50, "\n") + # print_models() \ No newline at end of file -- cgit v1.2.3