From c48ac5163c058acdd66079537b868b097571cd11 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 19 May 2026 19:26:10 +0200 Subject: [PATCH] fix: pass subscription_key and endpoint in bing.py CLI search_bing() call (#24768) The __main__ block called search_bing() with 4 positional arguments, but the function requires 5 (subscription_key, endpoint, locale, query, count). Running `python -m open_webui.retrieval.web.bing` raised a TypeError and, before failing, silently misrouted every argument. Read the key/endpoint from environment variables, matching config.py defaults. Closes #24765 Co-authored-by: Claude Opus 4.7 (1M context) --- backend/open_webui/retrieval/web/bing.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/retrieval/web/bing.py b/backend/open_webui/retrieval/web/bing.py index b026302b4b..2a38454b9d 100644 --- a/backend/open_webui/retrieval/web/bing.py +++ b/backend/open_webui/retrieval/web/bing.py @@ -64,5 +64,14 @@ def main(): args = parser.parse_args() - results = search_bing(args.locale, args.query, args.count, args.filter) + results = search_bing( + os.environ.get('BING_SEARCH_V7_SUBSCRIPTION_KEY', ''), + os.environ.get( + 'BING_SEARCH_V7_ENDPOINT', 'https://api.bing.microsoft.com/v7.0/search' + ), + args.locale, + args.query, + args.count, + args.filter, + ) pprint(results)