summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server/api.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-22 01:27:48 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-22 01:27:48 +0200
commit4bc4d635bca9c1c7633ff87ff24b757c653ff60f (patch)
tree6ed0cfc6cd53a3ab32565d6199a929ac1ea6ad80 /g4f/gui/server/api.py
parentImprove python support (diff)
downloadgpt4free-4bc4d635bca9c1c7633ff87ff24b757c653ff60f.tar
gpt4free-4bc4d635bca9c1c7633ff87ff24b757c653ff60f.tar.gz
gpt4free-4bc4d635bca9c1c7633ff87ff24b757c653ff60f.tar.bz2
gpt4free-4bc4d635bca9c1c7633ff87ff24b757c653ff60f.tar.lz
gpt4free-4bc4d635bca9c1c7633ff87ff24b757c653ff60f.tar.xz
gpt4free-4bc4d635bca9c1c7633ff87ff24b757c653ff60f.tar.zst
gpt4free-4bc4d635bca9c1c7633ff87ff24b757c653ff60f.zip
Diffstat (limited to 'g4f/gui/server/api.py')
-rw-r--r--g4f/gui/server/api.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py
index 435700ea..3d9f6a1c 100644
--- a/g4f/gui/server/api.py
+++ b/g4f/gui/server/api.py
@@ -45,16 +45,20 @@ class Api():
@staticmethod
def get_image_models() -> list[dict]:
image_models = []
- for key, provider in __map__.items():
+ for provider in __providers__:
if hasattr(provider, "image_models"):
if hasattr(provider, "get_models"):
provider.get_models()
+ parent = provider
+ if hasattr(provider, "parent"):
+ parent = __map__[provider.parent]
for model in provider.image_models:
image_models.append({
- "provider": key,
- "url": provider.url,
- "label": provider.label if hasattr(provider, "label") else None,
- "image_model": model
+ "provider": parent.__name__,
+ "url": parent.url,
+ "label": parent.label if hasattr(parent, "label") else None,
+ "image_model": model,
+ "vision_model": parent.default_vision_model if hasattr(parent, "default_vision_model") else None
})
return image_models