Add intelligence to your app using OpenAI’s SDK. Generate structured recipes from ingredients with prompt templates, call the API, and process outputs. Build a script to extract recipes from messy HTML and store them cleanly.
Overview
Syllabus
- Unit 1: Making Your First LLM Call
- Initialize OpenAI Client
- System Prompt Persona Transformation
- Update User Prompt to Arrow Functions in TypeScript
- Exploring Temperature Effects on AI Responses
- Model Selection and Comparison Loop
- Unit 2: Prompt Templates and Variables
- Implement loadTemplate Function for Static Prompts
- Implement renderTemplate Function
- Implement Custom Variable Substitution in Template Renderer
- Complete renderPromptFromFile Function
- Recipe Generator Prompt Template
- Unit 3: Building the LLM Manager
- Setup OpenAI Client in LLM Service
- Implement Prompt Rendering in generateResponse Function
- Integrate OpenAI Chat Completion in generateResponse
- Add Robust Error Handling to LLM Manager API Calls
- Unit 4: AI Recipe Generation
- Create Prompt Templates for Recipe Generation
- Implement Input Validation for Recipe Generation Route
- AI Recipe Generation Integration
- Implement Recipe Parsing Foundation
- Implement Recipe Parsing Logic
- Complete Recipe Generation Endpoint
- Unit 5: Extracting Recipes from HTML
- Create Recipe Extraction Prompt Templates
- Implement the extractRecipeFromHtml Function
- Implement parseRecipeString Function
- Implement Recipe Database Storage with Duplicate Check
- Implement Recipe Extraction CLI