From 72b2555953337f7e0ee121d0653c8dd3dbcf514a Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 15 May 2025 12:58:44 +0400 Subject: [PATCH] refac --- backend/open_webui/routers/pipelines.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/pipelines.py b/backend/open_webui/routers/pipelines.py index bd9cf6c78..f80ea91f8 100644 --- a/backend/open_webui/routers/pipelines.py +++ b/backend/open_webui/routers/pipelines.py @@ -69,7 +69,10 @@ async def process_pipeline_inlet_filter(request, payload, user, models): async with aiohttp.ClientSession(trust_env=True) as session: for filter in sorted_filters: urlIdx = filter.get("urlIdx") - if urlIdx is None: + + try: + urlIdx = int(urlIdx) + except: continue url = request.app.state.config.OPENAI_API_BASE_URLS[urlIdx] @@ -119,7 +122,10 @@ async def process_pipeline_outlet_filter(request, payload, user, models): async with aiohttp.ClientSession(trust_env=True) as session: for filter in sorted_filters: urlIdx = filter.get("urlIdx") - if urlIdx is None: + + try: + urlIdx = int(urlIdx) + except: continue url = request.app.state.config.OPENAI_API_BASE_URLS[urlIdx]