Migration lego-hunter to Tinyfish SDK #208
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
simantak-dabhade
left a comment
There was a problem hiding this comment.
Clean migration. Fixed next-env.d.ts. Build passes.
Migrates Lego Restock Hunter from OpenAI-based URL generation to the TinyFish SDK, removing the @ai-sdk/openai and ai dependencies entirely.
The original generate-urls route used GPT-4o-mini to hallucinate search URLs for 15 hardcoded retailers — results were often wrong or outdated. The new /api/discover-retailers runs two parallel TinyFish Search queries targeted at the specific LEGO set name, finding real current product pages across retailers without any LLM involvement.
/api/search-lego replaces the raw Mino SSE fetch with client.agent.stream — typed EventType.STREAMING_URL, EventType.PROGRESS, EventType.COMPLETE + RunStatus.COMPLETED, with result content validation. Deal analysis is now built-in price sorting logic rather than a second GPT-4o-mini call — no LLM needed to determine which price is lower.