Repository navigation
feat(aiclient): read the Bing search endpoint from BING_ENDPOINT - #3280
Open
SpecStream (Specstreamai) wants to merge 1 commit into
Open
SpecStream (Specstreamai) wants to merge 1 commit into
SpecStream (Specstreamai) wants to merge 1 commit into
Conversation
ApiSettings gets an optional endpoint, filled from BING_ENDPOINT (bing.endpoint in config). Unset keeps https://api.bing.microsoft.com/v7.0.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@microsoft-github-policy-service agree company="SpecStream SAS" |
Hillary Mutisya (hillary-mutisya)
approved these changes
Nov 13, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The configurable Bing-compatible search endpoint change has no active review issues.
No open issues 🎉
What changed in this PR
Adds configurable Bing-compatible search endpoints to the AI client, allowing web and image searches to use an alternative service while preserving the existing default URL.
Changes:
- Reads optional
BING_ENDPOINTconfiguration and removes trailing slashes before constructing search URLs. - Adds tests for endpoint loading and default/custom web and image search URLs.
- Documents the
bing.endpointconfiguration mapping.
| File | Description |
|---|---|
ts/packages/config/README.md |
Documents the mapping from bing.endpoint to BING_ENDPOINT. |
ts/packages/aiclient/test/bing.spec.ts |
Tests endpoint configuration and search request URLs. |
ts/packages/aiclient/src/bing.ts |
Adds optional endpoint settings and configurable search URL construction. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
createBingSearchalways builds its URLs fromhttps://api.bing.microsoft.com/v7.0, and only the key comes from settings. Microsoft's retirement notice says "Bing Search APIs will be retired on August 11, 2025. Any existing instances of Bing Search APIs will be decommissioned completely, and the product will no longer be available to be used or new customer signup." (https://learn.microsoft.com/en-us/lifecycle/announcements/bing-search-api-retirement), sosearchWeband thetextProcessingcaller get no results and there's nothing to point them at instead.This adds an optional
endpointtoApiSettingsand reads it fromBING_ENDPOINTinapiSettingsFromEnv, next toBING_API_KEY, the same way the other clients take*_ENDPOINT. It's the base that/searchand/images/searchare appended to, and a trailing slash is dropped. Unset or blank keepshttps://api.bing.microsoft.com/v7.0. The config flattener already turnsbing.endpointintoBING_ENDPOINT, so I added that row to the table inpackages/config/README.md.test/bing.spec.tsstubsfetchand checks thatapiSettingsFromEnvleaves the endpoint unset by default and readsBING_ENDPOINT, and that web and image searches go to Bing without it and to the configured base with it. Inpackages/aiclient,pnpm run tsc,pnpm run test:local(33 suites, 643 tests) andpnpm run prettierpass.I run a search API that answers in the Bing v7 format, which is how I ran into this.