浏览代码

fix: openai proxy issue

Timothy J. Baek 1 年之前
父节点
当前提交
b188143f01
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      backend/apps/openai/main.py

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

@@ -198,7 +198,9 @@ async def get_all_models():
                 list(
                     map(
                         lambda response: (
-                            response["data"] if "data" in response else None
+                            response["data"]
+                            if response and "data" in response
+                            else None
                         ),
                         responses,
                     )