瀏覽代碼

chore: format

Timothy J. Baek 7 月之前
父節點
當前提交
4ead3c5b80
共有 1 個文件被更改,包括 17 次插入17 次删除
  1. 17 17
      backend/open_webui/apps/openai/main.py

+ 17 - 17
backend/open_webui/apps/openai/main.py

@@ -191,8 +191,8 @@ async def fetch_url(url, key):
 
 
 async def cleanup_response(
-        response: Optional[aiohttp.ClientResponse],
-        session: Optional[aiohttp.ClientSession],
+    response: Optional[aiohttp.ClientResponse],
+    session: Optional[aiohttp.ClientSession],
 ):
     if response:
         response.close()
@@ -217,18 +217,18 @@ def merge_models_lists(model_lists):
                     }
                     for model in models
                     if "api.openai.com"
-                       not in app.state.config.OPENAI_API_BASE_URLS[idx]
-                       or not any(
-                    name in model["id"]
-                    for name in [
-                        "babbage",
-                        "dall-e",
-                        "davinci",
-                        "embedding",
-                        "tts",
-                        "whisper",
-                    ]
-                )
+                    not in app.state.config.OPENAI_API_BASE_URLS[idx]
+                    or not any(
+                        name in model["id"]
+                        for name in [
+                            "babbage",
+                            "dall-e",
+                            "davinci",
+                            "embedding",
+                            "tts",
+                            "whisper",
+                        ]
+                    )
                 ]
             )
 
@@ -371,9 +371,9 @@ async def get_models(url_idx: Optional[int] = None, user=Depends(get_verified_us
 @app.post("/chat/completions")
 @app.post("/chat/completions/{url_idx}")
 async def generate_chat_completion(
-        form_data: dict,
-        url_idx: Optional[int] = None,
-        user=Depends(get_verified_user),
+    form_data: dict,
+    url_idx: Optional[int] = None,
+    user=Depends(get_verified_user),
 ):
     idx = 0
     payload = {**form_data}