Skip to content

feat: add optional endpoint to the Bing and Google web searchers - #198

Merged
ChenZiHong-Gavin merged 1 commit into
InternScience:mainfrom
Specstreamai:web-search-endpoint
Nov 24, 2026
Merged

ChenZiHong-Gavin merged 1 commit into
InternScience:mainfrom
Specstreamai:web-search-endpoint

Conversation

@Specstreamai

Copy link
Copy Markdown
Contributor

BingSearch and GoogleSearch now take an optional endpoint argument, and requests go to self.endpoint. The defaults are still BING_SEARCH_V7_ENDPOINT and GOOGLE_SEARCH_ENDPOINT, so existing code behaves the same. Both docstrings describe the new parameter.

Microsoft retired the Bing Web Search API in August 2025, and Google's Custom Search JSON API ends on January 1, 2027. With endpoint, both searchers keep working against any service that implements the same API:

searcher = BingSearch(subscription_key, endpoint="https://search.example.com/v7.0/search")

We run SpecStream, a search API that serves these request formats, which is how we found the gap.

Tests: tests/unit_tests/models/searcher/test_web_search_endpoint.py adds 4, the default and a custom endpoint for each searcher. pytest tests/unit_tests gives 35 passed, and black 22.10 and isort are clean.

@ChenZiHong-Gavin
ChenZiHong-Gavin merged commit efc930f into InternScience:main Nov 24, 2026
6 checks passed
@ChenZiHong-Gavin

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. The change is backward compatible and well tested, so merged. Note that endpoint isn't wired into the config yet, so for now it only applies when the searcher classes are constructed directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants