Skip to content

feat: SerpApi integration tools (hotels, reviews, YouTube) - #451

Closed
esafwan wants to merge 1 commit into
developfrom
feat/serp-tools
Closed

feat: SerpApi integration tools (hotels, reviews, YouTube)#451
esafwan wants to merge 1 commit into
developfrom
feat/serp-tools

Conversation

@esafwan

@esafwan esafwan commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

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_token
  • serp_hotel_details — OTA price table, reviews_breakdown sentiment topics, amenities, images
  • serp_hotel_details_batch — ThreadPool batch details (max_workers=8) with per-token error capture

Reviews (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_token
  • serp_google_hotel_reviews — star distribution + reviews_breakdown
  • serp_tripadvisor_search — ssrc categories, domain, offset/limit
  • serp_tripadvisor_reviews — sort most_recent|detailed_review, rating csv, language, translate; next_offset
  • serp_yelp_search / serp_yelp_reviews — find_desc/find_loc, full sortby enum, start/num

YouTube

  • serp_youtube_search — youtube engine, gl/hl/sp, parsed video_ids
  • youtube_transcript — no API key needed (youtube-transcript-api, lazy import), language preference list

Design

  • App Provided pattern: handlers in huf/ai/tools/serp_{common,hotels,reviews,youtube}.py, registered in _registry.py; no DocType/frontend changes.
  • New serpapi Integration Service in register_integration_services() — config UI + Password credential out of the box; SERPAPI_API_KEY env fallback. Consolidates the 3 different key sources the source app used.
  • serpapi + youtube-transcript-api added to dependencies; both imported lazily.
  • Source bugs intentionally not ported: duplicated key helpers, allow_guest endpoints, 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/format clean on new files; no new findings in edited files; compileall clean.

Companion to the Google Places tools PR. Merge order-independent (disjoint files except _registry.py/credentials.py; will rebase if needed).

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.
@esafwan

esafwan commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by consolidated SerpApi PR #465, now included in integration PR #468.

@esafwan esafwan closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant