feat: SerpApi integration tools (hotels, reviews, YouTube) - #451
Closed
esafwan wants to merge 1 commit into
Closed
Conversation
Adds 11 App Provided tools (category: SERP) ported from Travel-with-Genie-AI/google_services with full param coverage: - serp_hotel_search / serp_hotel_details / serp_hotel_details_batch: google_hotels engine with the full filter set (dates, guests, price, rating, class, amenities, brands, vacation rentals, pagination) - serp_google_maps_reviews, serp_google_hotel_reviews, serp_tripadvisor_search, serp_tripadvisor_reviews, serp_yelp_search, serp_yelp_reviews: two-step query-to-id resolution with engine-native sort enums and pagination shapes - serp_youtube_search, youtube_transcript (transcript needs no key) New serpapi Integration Service (config UI + Password credential, SERPAPI_API_KEY env fallback). serpapi + youtube-transcript-api added to dependencies. Keys resolved lazily; no guest access; read-only.
Contributor
Author
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
Ports the SerpApi integrations from Travel-with-Genie-AI/google_services@develop into huf as first-class App Provided tools — with full parameter coverage and the source's normalized output shapes.
Tools (11, category: SERP)
Hotels (google_hotels engine)
serp_hotel_search— full filter set: dates, adults/children/ages, currency/gl/hl, sort_by (3|8|13), min/max price, rating (7|8|9), hotel_class, property_types, amenities, brands, free_cancellation/special_offers/eco_certified, vacation_rentals (+bedrooms/bathrooms), next_page_tokenserp_hotel_details— OTA price table, reviews_breakdown sentiment topics, amenities, imagesserp_hotel_details_batch— ThreadPool batch details (max_workers=8) with per-token error captureReviews (two-step query → id resolution with
matched_*echo)serp_google_maps_reviews— data_id/place_id or query; sort qualityScore|newestFirst|ratingHigh|ratingLow; next_page_tokenserp_google_hotel_reviews— star distribution + reviews_breakdownserp_tripadvisor_search— ssrc categories, domain, offset/limitserp_tripadvisor_reviews— sort most_recent|detailed_review, rating csv, language, translate; next_offsetserp_yelp_search/serp_yelp_reviews— find_desc/find_loc, full sortby enum, start/numYouTube
serp_youtube_search— youtube engine, gl/hl/sp, parsed video_idsyoutube_transcript— no API key needed (youtube-transcript-api, lazy import), language preference listDesign
huf/ai/tools/serp_{common,hotels,reviews,youtube}.py, registered in_registry.py; no DocType/frontend changes.register_integration_services()— config UI + Password credential out of the box;SERPAPI_API_KEYenv fallback. Consolidates the 3 different key sources the source app used.serpapi+youtube-transcript-apiadded to dependencies; both imported lazily.allow_guestendpoints, hardcoded gl/hl (exposed as params), mid-request commits.Testing
huf/ai/tests/test_serp_tools.py— 50 unit tests (param building incl. every enum and conditional gate, pagination shapes, two-step resolution, Yelp sortby quirk, video_id parsing, transcript language coercion, error envelopes, registry wiring), all passing with mocked serpapi client.ruff check/formatclean on new files; no new findings in edited files;compileallclean.Companion to the Google Places tools PR. Merge order-independent (disjoint files except
_registry.py/credentials.py; will rebase if needed).