summaryrefslogtreecommitdiffstats
path: root/etc/tool
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-21 15:15:55 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-21 15:15:55 +0200
commita26421bcd8b8580650fa05b3fb4f8fdfa0ef9921 (patch)
treeb1c7ff275c54682e29f89f07638b8fdd1743e0e1 /etc/tool
parentAdd MissingRequirementsError to You (diff)
downloadgpt4free-a26421bcd8b8580650fa05b3fb4f8fdfa0ef9921.tar
gpt4free-a26421bcd8b8580650fa05b3fb4f8fdfa0ef9921.tar.gz
gpt4free-a26421bcd8b8580650fa05b3fb4f8fdfa0ef9921.tar.bz2
gpt4free-a26421bcd8b8580650fa05b3fb4f8fdfa0ef9921.tar.lz
gpt4free-a26421bcd8b8580650fa05b3fb4f8fdfa0ef9921.tar.xz
gpt4free-a26421bcd8b8580650fa05b3fb4f8fdfa0ef9921.tar.zst
gpt4free-a26421bcd8b8580650fa05b3fb4f8fdfa0ef9921.zip
Diffstat (limited to '')
-rw-r--r--etc/tool/readme_table.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/etc/tool/readme_table.py b/etc/tool/readme_table.py
index 895b515f..b56e4bca 100644
--- a/etc/tool/readme_table.py
+++ b/etc/tool/readme_table.py
@@ -14,6 +14,8 @@ async def test_async(provider: ProviderType):
return False
messages = [{"role": "user", "content": "Hello Assistant!"}]
try:
+ if "webdriver" in provider.get_parameters():
+ return False
response = await asyncio.wait_for(ChatCompletion.create_async(
model=models.default,
messages=messages,
@@ -88,7 +90,7 @@ def print_models():
"huggingface": "Huggingface",
"anthropic": "Anthropic",
"inflection": "Inflection",
- "meta": "Meta"
+ "meta": "Meta",
}
provider_urls = {
"google": "https://gemini.google.com/",
@@ -96,7 +98,7 @@ def print_models():
"huggingface": "https://huggingface.co/",
"anthropic": "https://www.anthropic.com/",
"inflection": "https://inflection.ai/",
- "meta": "https://llama.meta.com/"
+ "meta": "https://llama.meta.com/",
}
lines = [
@@ -108,6 +110,8 @@ def print_models():
if name not in ("gpt-3.5-turbo", "gpt-4", "gpt-4-turbo"):
continue
name = re.split(r":|/", model.name)[-1]
+ if model.base_provider not in base_provider_names:
+ continue
base_provider = base_provider_names[model.base_provider]
if not isinstance(model.best_provider, BaseRetryProvider):
provider_name = f"g4f.Provider.{model.best_provider.__name__}"
@@ -121,7 +125,24 @@ def print_models():
print("\n".join(lines))
+def print_image_models():
+ lines = [
+ "| Label | Provider | Model | Website |",
+ "| ----- | -------- | ----- | ------- |",
+ ]
+ from g4f.gui.server.api import Api
+ for image_model in Api.get_image_models():
+ provider_url = image_model["url"]
+ netloc = urlparse(provider_url).netloc.replace("www.", "")
+ website = f"[{netloc}]({provider_url})"
+ label = image_model["provider"] if image_model["label"] is None else image_model["label"]
+ lines.append(f'| {label} | {image_model["provider"]} | {image_model["image_model"]} | {website} |')
+
+ print("\n".join(lines))
+
if __name__ == "__main__":
print_providers()
print("\n", "-" * 50, "\n")
- print_models() \ No newline at end of file
+ print_models()
+ print("\n", "-" * 50, "\n")
+ print_image_models() \ No newline at end of file