build a SaaS with Gemini 3 in Cursor
Quick Overview
The video successfully refactors an Open SaaS template demo app to use OpenAI's Structured Outputs feature by implementing a collaborative chat interface, which allows for iterative plan refinement before committing tasks to the final schedule, demonstrating a more robust and user-friendly planning workflow than direct function calling.
Key Points: The core refactoring involved switching the function to use the method with for structured output. A new collaborative planning flow was introduced, replacing the immediate schedule generation with a chat interface where users can review and iterate on the AI-suggested plan before acceptance. The plan involves backend updates in to define and implement and actions. Frontend updates in include creating a component to handle chat history, display proposed plans with "Preview" and "Accept" buttons, and pass tasks/hours to the chat. The speaker tested the new feature by inputting tasks like 'film it all for a dope video' and received a structured, prioritized schedule that they could collaboratively refine via chat. The model was suggested over due to better support for Structured Outputs and cost-effectiveness. The resulting daily schedule successfully broke down main tasks into subtasks, showing high, medium, and low priorities clearly.
Context: The video demonstrates a technical enhancement to an existing AI-powered daily scheduler demo application, which was originally built using Wasp and relied on direct function calling to OpenAI's API for schedule generation. The presenter aims to improve this process by introducing a conversational, collaborative planning interface that leverages OpenAI's Structured Outputs feature for more reliable, schema-enforced responses.
Detailed Analysis
The presenter walks through the process of refactoring a demo SaaS application, specifically the AI Day Scheduler, to utilize OpenAI's Structured Outputs feature instead of traditional function calling. The main goal is to introduce a collaborative chat interface where the user and AI can refine the generated schedule before it is committed. The plan involves specific backend updates in to define a using Zod, implement new actions like (which uses with the schema) and , and move credit decrement logic. Frontend changes focus on creating a component in to manage chat history, display proposed plans with 'Preview' and 'Accept' buttons, and integrate this new flow to replace the old 'Generate Schedule' button. The demo successfully shows the AI prioritizing tasks based on user input and then offering a detailed breakdown of subtasks upon request, which is then committed to the final schedule upon user acceptance, proving the effectiveness and robustness of the structured output approach.