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) <noreply@anthropic.com>
This commit is contained in:
Classic298
2026-05-19 21:26:10 +04:00
committed by GitHub
co-authored by Claude Opus 4.7
parent 2ca91ceeec
commit c48ac5163c
+10 -1
View File
@@ -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)