summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorabc <98614666+xtekky@users.noreply.github.com>2023-09-23 02:29:55 +0200
committerabc <98614666+xtekky@users.noreply.github.com>2023-09-23 02:29:55 +0200
commit07063b0fd83dc7bb76b095015042a97a2ccff330 (patch)
treef26ada752052dd53f34dea75a3db6e302380afe6
parent~ | new providers (diff)
downloadgpt4free-07063b0fd83dc7bb76b095015042a97a2ccff330.tar
gpt4free-07063b0fd83dc7bb76b095015042a97a2ccff330.tar.gz
gpt4free-07063b0fd83dc7bb76b095015042a97a2ccff330.tar.bz2
gpt4free-07063b0fd83dc7bb76b095015042a97a2ccff330.tar.lz
gpt4free-07063b0fd83dc7bb76b095015042a97a2ccff330.tar.xz
gpt4free-07063b0fd83dc7bb76b095015042a97a2ccff330.tar.zst
gpt4free-07063b0fd83dc7bb76b095015042a97a2ccff330.zip
-rw-r--r--testing/test_providers.py1
-rw-r--r--tool/readme_table.py26
2 files changed, 17 insertions, 10 deletions
diff --git a/testing/test_providers.py b/testing/test_providers.py
index 5240119b..30df147a 100644
--- a/testing/test_providers.py
+++ b/testing/test_providers.py
@@ -37,6 +37,7 @@ def get_providers() -> list[type[BaseProvider]]:
ignore_names = [
"annotations",
"base_provider",
+ "retry_provider",
"BaseProvider",
"AsyncProvider",
"AsyncGeneratorProvider"
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