paint-brush
How to Build a Recipe Generator AI Chatbot With Coze by@bennykillua
625 reads
625 reads

How to Build a Recipe Generator AI Chatbot With Coze

by killuaOctober 26th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

This comprehensive tutorial walks you through how to build an AI chatbot on the Coze platform. Visit Coze and Telegram Web to create an account. Create a Chatbot with GPT-4o Configure the bot with Google search, YouTube, and Food Calorie plugins. Testing your bot Publishing your Receipe Generator AI Chatbot via Telegram @CozeReceipeGeneratorbot or on the Coze Store
featured image - How to Build a Recipe Generator AI Chatbot With Coze
killua HackerNoon profile picture

Before reading, try the Recipe Generator AI Chatbot via Telegram @CozeReceipeGeneratorbot or on the Coze Store!



Start a chat with the bot with a list of foodstuffs in your fridge or kitchen, and watch it dish out random recipes you can try!

Ever find yourself looking into your fridge and around the kitchen, unsure of what to cook with the ingredients you have? Say goodbye to indecision! With Coze AI, you can build a smart recipe generator chatbot that helps you whip up delicious meals using what’s already in your kitchen.


This article walks you through creating a personalized AI-powered Recipe Generator assistant that suggests recipes based on your available ingredients. This will make meal planning more manageable and fun for you!

What is Coze AI?

Coze is a no-code/low-code platform developed by ByteDance that allows users to build and develop next-generation AI applications and chatbots regardless of their programming experience. These custom chatbots can be integrated into various messaging platforms such as Telegram and Discord, giving them access to powerful large language models (LLMs).


If you want to learn more about Coze AI, you should check out the official documentation.

TL;DR

This comprehensive tutorial walks you through how to build an AI chatbot on the Coze platform.


  • Create a Chatbot with GPT-4o and configure the bot with Google search, YouTube, and Food Calorie plugins.


  • Testing your bot.


Prerequisites

To follow along with this tutorial, you will need the following:

  • A Coze account. Visit the signup page to create an account.


  • A Telegram account. Visit Telegram Web to create an account.

Create Your First AI Bot From Scratch in Coze

To get started:

  1. Log in to Coze, and visit the Workspace tab in the left menu. You will automatically redirected to your Personal workspace.


  2. Click Create Agent.


  3. Personalize your bot by giving it an Agent Name and Agent Function Description. For our, I am naming it “Recipe Generator AI Chatbot”, with the description being “You are a bot that helps you create receipts based on what you have. Simply tell me your ingredients, and I will give you recipe ideas based on what's available in your kitchen. Whether you're in the mood for a snack, a full meal, or a protein-packed dish tailored for your gym routine, I have options.

  4. Click on Icon to upload a pic. Alternatively, you can use the Optimize icon to generate an avatar using the DALL·E-3 model.

  5. Click Confirm.

Developing and Configuring Your AI Bot

After you confirm your bot creation, you will be redirected to the Develop page. This is where you configure the bot by picking its model and capabilities—does your bot need external knowledge, workflows, databases, and plugins? However, first, we need to define our bot persona and prompt. To get started:


  1. In the Persona & Prompt area, enter instructions. These instructions help your bot generate a response for your users. The prompt you give your bot will also determine the quality of the response.


  2. Click on the Optimize icon to improve your prompt. The output is markdown text, which you can find in this GitHub gist.

3. Next, you can change the model your bot uses. However, I will stick to the default CPT-40 (8K).

**Testing Your Chatbot

\ While there is still so much work to be done, we can test how good it is. To do this, head to the Preview and Debug panel, enter this prompt in the provided field, and click Send: i  got yam, egg, stew, chicken spaghetti and rice right now. what meal can i use cook? any suggestion?

Now, that works great!

Adding More Capabilities to Our Chatbot

While the bot works fine, you can improve it significantly by adding plugins. Plugins are add-ons that add more functionality to an application without changing the original code. They do this by calling external APIs.

** **

Coze currently has over 200 plugins available for you to explore at the plugin store. If you don't see a plugin that fits your use case, you can always create a custom plugin. This comprehensive guide can help you get started on plugin building.


  1. At the plugins field, click the + icon.


  2. Find the plugin you want. For example, you can search for the Google Web Search plug-in, and click Add googlewebSearch endpoint.

![](https://cdn.hackernoon.com/images/6y0WVYgSxtZxyZYUrXxGRQQ48qN2-2024-10-26T02:18:30.544Z-dvv7fnbt5qxmm1fupcfr5dnl)
  1. Similarly, search and add these plugins.

    1. The YouTube plugin and add the get_video_meta and search_video endpoint.

    2. The Food Calorie Search plugin and add the Food_calories endpoint.


  2. Exit the plugin dialog box.


  3. Hover on the plugin you want to use and Copy it.



  4. You can add that plugin with the Copy within your prompt. For example, add the text In the GitHub gist to the Diet-friendly Meals section of your prompt after the instructions.


  5. Retest your bot with a new prompt like i  got yam, egg, stew, chicken spaghetti and rice right now. what meal can I use cook? any suggestion? i want a diet meal for the gym”


  6. Click Send.

Publish Your Bot

After testing your bot and adding additional functionality to it, you can go ahead and publish it.

  1. Click on Publish on the Develop page.

  2. Click Generate to generate a Changelog.

  3. Select a publishing channel. For this article, I suggest Telegram.

    1. Visit BotFather on telegram.
    2. Start if this is your first time.
    3. Enter the /newbot command in the dialog box.
    4. Give your bot a name: CozeReceiptGenerator.
    5. Give your bot a username:  CozeReceiptGeneratorbot.
    6. Save the token BotFather returns.
  4. Click on Configure Telegram and enter the token.

  5. Tick Telegram as your publishing platform.

  6. Click Publish.

  7. Click Finish.


What’s Next? Explore the Bot!



Explore the bot! Try the Recipe Generator AI Chatbot via Telegram @CozeReceipeGeneratorbot or on the Coze Store. Simply tell it what you have in your kitchen, and let's start cooking!


Coze AI makes chatbot creation seamless and exciting without writing a single line of code. And if it gets to code, you can also customise your bot with plugins, data, external APIs, and databases. By leveraging Coze features, you can build AI applications that do almost anything! Learn more about the tool by exploring Coze YouTube.


If you have read this far, I appreciate it! You can connect with me on Twitter, LinkedIn, or iheifeanyi [at] gmail.com


Please do drop a like or comment. Thanks, and enjoy your meal! ❤️🚀🙏🏽