summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server/api.py
diff options
context:
space:
mode:
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