Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Recipe Genie: Powered by AI 🤖
K Om Senapati
K Om Senapati

Posted on • Edited on

     

Recipe Genie: Powered by AI 🤖

In Quira Quest 16, I took my project Recipe Genie (earlier submitted to Quira Quest 12) and added more features including AI recipe generation and more to make it accessible to users.

Enter fullscreen modeExit fullscreen mode

Let's take a look at the new features:

1️⃣ Text to Speech

I created a component text-to-speech that takes some text to be converted to speech and renders buttons like play/resume, pause, and stop to control the audio.

You can take a look at this component here:

Code
constTextToSpeech=({text})=>{const[isPaused,setIsPaused]=useState(false);const[utterance,setUtterance]=useState(null);useEffect(()=>{...},[text]);consthandlePlay=()=>{...};consthandlePause=()=>{...};consthandleStop=()=>{...};return(<divclassName="flex flex-row-reverse gap-5 py-2"><buttononClick={handleStop}><StopIcon/></button><buttononClick={handlePause}><PauseIcon/></button><buttononClick={handlePlay}>{isPaused?<ResumeIcon/>:<PlayIcon/>}</button></div>);};exportdefaultTextToSpeech;
Enter fullscreen modeExit fullscreen mode

See the fullsource code.


2️⃣ AI-Generated Recipe

For generating recipes with AI, I choose to use Vercel AI SDK as it's easy to use and also gives a lot of features like structured outputs from LLMs(I am using this feature to generate recipes for users) out of the box and GROQ API as it's free.

I created a route/api/generate-recipe which has a POST route which takes in inputs like userPrompt, dishType, and dietaryRestrictions and creates a prompt for passing into LLM.

Then usinggenerateObject() of Vercel AI SDK, it creates the recipe object and returns it as a response.

See the fullsource code for this route.

I integrated this into a form and attached the form, along with the recipe rendering component, to the/ai route of the application.

3️⃣ Ai Recipe Image Generation

I also added AI image generation for these recipes using the recipe name and user prompt. I usedhttps://pollinations.ai/'s free API to do it.

See the fullsource code for this route.

4️⃣ Speech to Text

I implemented a speech-to-text feature for the input field of the above-discussed form, allowing users to speak their prompt, which is then captured automatically.

See the fullsource code for this component.

Enter fullscreen modeExit fullscreen mode

🧑‍💻 Developer Experience/Findings

Developer

  • First I started with zod schema without any description then it gave some error that it couldn't generate the recipe object. Then I added a description for the schema usingdescribe() method of zod and it worked. You can see the schemahere.

  • I found out that the Meta Llama 3 8B model performs better than the Mixtral 8x7b model.

  • Also as I was using Vercel AI SDK, I didn't have to use any external tooling as I had access togenerateObject().

  • Groq API is very fast and it works like a charm.

Enter fullscreen modeExit fullscreen mode

If you enjoyed 💖 this project, I’d appreciate your support! You can vote 🗳️ for my submission in the quest and star ⭐ the repo.

Vote 🙏

Star Recipe Genie AI ⭐

That’s all for today—thanks so much for reading! If you have any thoughts or questions, feel free to reach out.

Feel free to connect with me onX as well!

Bye

Top comments(8)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
divyasinghdev profile image
Divya
A curious lifelong learner, currently a full-time Masters student persuing Computer Science stream. Enthusiastic about development.
  • Joined

Keep it up!
Another great project 🚀

CollapseExpand
 
k0msenapati profile image
K Om Senapati
Hi, I'm K Om Senapati, a 2nd-year B.Tech CSE student at OUTR, Bhubaneswar, and a Python developer passionate about hackathons, teamwork, and exploring new technologies.
  • Location
    Bhubaneswar, India
  • Education
    Odisha University of Technology and Research
  • Pronouns
    He/Him
  • Joined

Thanks

CollapseExpand
 
rohan_sharma profile image
Rohan Sharma
Dive deeper than the deepest! || Programmer || Developer || Designer || Technical Writer
  • Email
  • Location
    Bihar, India
  • Education
    B.tech, Nalanda College of Engineering, Chandi, 2022-26
  • Pronouns
    he/him
  • Joined

Nice Project!

CollapseExpand
 
k0msenapati profile image
K Om Senapati
Hi, I'm K Om Senapati, a 2nd-year B.Tech CSE student at OUTR, Bhubaneswar, and a Python developer passionate about hackathons, teamwork, and exploring new technologies.
  • Location
    Bhubaneswar, India
  • Education
    Odisha University of Technology and Research
  • Pronouns
    He/Him
  • Joined

Thanks ☺️

CollapseExpand
 
jennie_py profile image
Priya Yadav
developer||Learner

Nice project):

CollapseExpand
 
k0msenapati profile image
K Om Senapati
Hi, I'm K Om Senapati, a 2nd-year B.Tech CSE student at OUTR, Bhubaneswar, and a Python developer passionate about hackathons, teamwork, and exploring new technologies.
  • Location
    Bhubaneswar, India
  • Education
    Odisha University of Technology and Research
  • Pronouns
    He/Him
  • Joined

Thanks Jennie

CollapseExpand
 
audreydev profile image
Audrey Delgado
Hi 👋🏼I'm a self-taught, full stack software developer based in Southern California.
  • Location
    Southern California.
  • Joined

Cool project.

CollapseExpand
 
aviralgarg05 profile image
Aviral Garg
  • Email
  • Location
    New Delhi, India
  • Education
    Guru Gobind Singh Indraprastha University
  • Pronouns
    He/Him
  • Joined

Nice one

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Hi, I'm K Om Senapati, a 2nd-year B.Tech CSE student at OUTR, Bhubaneswar, and a Python developer passionate about hackathons, teamwork, and exploring new technologies.
  • Location
    Bhubaneswar, India
  • Education
    Odisha University of Technology and Research
  • Pronouns
    He/Him
  • Joined

More fromK Om Senapati

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp