Add Microsoft Web IQ as a search and scraper provider#261
Open
mainhanu wants to merge 4 commits into
Open
Conversation
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.
Summary
Adds microsoftWebIQ as a new option for both the search provider and the scraper provider in the search tool, alongside the existing Serper / SearXNG / Tavily / Firecrawl integrations.
core logic is
src/tools/search/microsoft-scraper.ts&src/tools/search/microsoft-search.ts(~ 500 lines), most of the rest code is for ut & local test scriptWhat's included
microsoft-search.ts) — wraps the Web IQ search endpoints:POST /v3/search/web(withcontentFormat: 'passage'for query-relevant snippets) →organic.POST /v3/search/news→topStories+news, mirroring how Serper folds news into top stories.POST /v3/search/videos→videos(title, link, snippet, thumbnail, duration, channel, source, date).POST /v3/search/images→images(title, image url, dimensions, thumbnail, host page link, source/domain).safeSearchis mapped to the API'soff/strictenum for the videos and images endpoints.microsoft-scraper.ts) — implementsBaseScraperoverPOST /v3/browsewithliveCrawl: 'none'(indexed content only). Non-200 responses (202 crawl-in-progress, 404 not-indexed) are treated as scrape failures so the source is skipped rather than retried.createSearchAPIand the scraper selector intool.ts, including config plumbing (microsoftWebIQApiKey,microsoftWebIQBaseUrl,microsoftWebIQSearchOptions,microsoftScraperOptions). Videos and images are supported, so the paralleltype: 'videos'/type: 'images'sub-searches fan out and merge into the result.MicrosoftWebIQSearchOptions,MicrosoftScraperConfig,MicrosoftScrapeOptions, andMicrosoftBrowseResponse; extends theSearchProvider/ScraperProviderunions.microsoft.test.ts) — covers missing API key, empty query, web→organic, news→topStories, videos→videos, images→images mapping, request failure, and scraper 200/202/404 handling (11 tests).scripts/microsoft_search.ts,npm run search:microsoft) — exercises web, news, video, and image search, the Browse scraper, and the full search tool against the live API.Configuration
Credentials are read from config or
MICROSOFT_WEBIQ_API_KEY/MICROSOFT_WEBIQ_BASE_URL(defaults tohttps://api.microsoft.ai/v3).Testing
npx jest src/tools/search/microsoft.test.ts— 11/11 passingtsc --noEmitand ESLint cleansearch
librechat.search.mov
scraper
librechat.loader.-.1080p.mov