فهرست منبع

fix: prefix issue

Timothy Jaeryang Baek 5 ماه پیش
والد
کامیت
d5c65e36c9
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      backend/open_webui/apps/openai/main.py

+ 3 - 1
backend/open_webui/apps/openai/main.py

@@ -313,7 +313,9 @@ async def get_all_models_responses() -> list:
             prefix_id = api_config.get("prefix_id", None)
 
             if prefix_id:
-                for model in response["data"]:
+                for model in (
+                    response if isinstance(response, list) else response.get("data", [])
+                ):
                     model["id"] = f"{prefix_id}.{model['id']}"
 
     log.debug(f"get_all_models:responses() {responses}")