How to create PDF Chat discord bot without coding skills

Are you interested in creating a PDF chat Discord bot but lack coding knowledge? Donā€™t worry, itā€™s easier than you think! In this article, we will guide you through the process of creating a PDF Discord bot without coding skills.

Header image for How to create PDF Chat discord bot without coding skills

Step1: Understanding the Discord Bot Structure

Letā€™s first understand the structure of our PDF Chat discord bot.

Overview of PDF Chat discord bot

Discord-with-flowise: Until recently, there wasnā€™t a reliable no-code solution available for building a real-time Discord bot. Therefore, Iā€™ve made an application that you can simply need to run (donā€™t worry, you can refer to my previous articles to understand the bare minimum knowledge required before running the code).

Flowise AI: This open-source software helps you build your own LLM apps. It enables you to connect multiple services like OpenAI and Pinecone via drag-and-drop functionality. In this instance, weā€™ll use it to store the PDF, embed it, convert it into a vector database, and retrieve related information from the PDF. If youā€™re unfamiliar with terms like Pinecone, text embedding, and vector databases, you can refer to my popular article which explains these concepts for beginners.

The core logic here is controlled by Discord-with-flowise. When a user inputs data using the /command ā€œflowiseā€ along with their input text, Discord-with-flowise sends it to the Flowise AI application to fetch related information for the PDF bot.

Step 2: Choose a Platform and register accounts

Firstly, you need to set up a Discord application and get a token (think of it as a secret number). For instructions on how to do this, refer to the following article.

Next, decide on a platform to host your PDF Discord bot. This will determine which cloud hosting services you use for main.py and flowise AI. I use Replit, and Iā€™ll show you how to set that up here. Please register if you donā€™t already have an account (not sponsored).

Other cloud platforms you could consider include AWS, Azure, and Vercel.

To use the Flowise AI application, youā€™ll also need to sign up for OpenAI and acquire an API key. For instructions on how to do this, check below article.

Additionally, youā€™ll need a Pinecone account and create an index within Pinecone. Here are articles on how to create an index and how to get an API key.

Step 3: Create a Discord-with-flowise on a Cloud Host

The next step is to create a new bot script on a hosting service. On Replit, you can build an application on top of a template. Iā€™ve created an application template for Flowise, so you can simply go to the template below and start forking it to your account.

If you are using different platform, you can copy the code from here.

start forking the template to your account

Youā€™re now going to set variables for your project. Navigate to ā€œSecretā€ tools and click ā€˜edit as Jsonā€™. Paste the following code. You will change the values later.

Where Secret tools and edit as Json is.
{
"URL": "Paste URL here",
"DISCORD_BOT_SECRET": "Secret token here",
"API_KEY": "Bearer API key here"
}

You should now see a setting like this. Youā€™ll come back here later to update the values.

Secret key value screen

Step 4: Set up flowise AI

Create a new project in Replit with flowise AI and follow the instructions here:

You should now see your Flowise application running (recommended to open in a new browser tab). Click ā€˜add newā€™.

initial screen of flowise application

Go to settings.

Where the settings is.

Click ā€˜Load chatflowā€™

Where the load chat is.

Youā€™ll be prompted to upload a file. Download the Json file from the following GitHub page and upload it. You need to sign in to download the files.

Now, all you need to do is customize the following inputs.

  1. Chunk size & chunk overlap: Leave these as they are for now. Weā€™ll return to this section later to enhance the botā€™s quality.
  2. PDF file: Upload the file you want to search. For example, a Bitcoin paper.
  3. OpenAI key: Enter your OpenAI API key obtained in previous steps.
  4. Model name and temperature: Leave these as they are for now. Weā€™ll return to this section later to enhance the botā€™s quality.

Pinecone-related input (API key, Pinecone environment, Pinecone namespace): Consult the previously linked articles to find these pinecone values. For example:

API key ā†’ abcdefgPinecone
Environment ā†’ us-west4-gcp-free
Pinecone index ā†’ test
namespace: name it in a way that you can identify later

Once youā€™ve filled in all the inputs, save your project with the bottom on the top.

Step5: Get URL address and API key

Navigate to the API endpoint section.

Switch to the Python tab and choose the ā€˜Default keyā€™.

Where the python tab and Default key are

Youā€™ve now generated your applicationā€™s URL and API key. Copy the values.

Step6: Apply secret value to the Discord-with-flowise

Return to the Discord-with-flowise project on Replit and input the secret values we generated earlier. The Discord bot token was created in Step 2, while the URL and API key were generated in Step 5.

Step7: Test your bot

Finally, click ā€˜runā€™ on Discord-with-flowise and look for the following message in the console. This indicates that your bot is running.

Console message when bot is running

To test your bot, go to the Discord server where you invited your bot in Step 2. Ask it a question about the PDF using the command /flowise. If all is well, it should be able to understand the context within the PDF.

How the bot answer to the question

Step 8: Customize Your Bot

If youā€™re not satisfied with your botā€™s performance, you can make a few modifications.

  • Change the chunk sizes and overlap. You can refer to our popular articles to learn about this concept.

Congratulations!!

Congratulations! You have successfully created a PDF Discord bot without any coding skills! With your new bot, you can easily share PDFs with your friends and colleagues on Discord.

We hope this guide was helpful, and if it was, please give it a clap and leave your feedback in the comments below.

Ready to Understand AI Without the Coding?

Are you eager to dive deeper into the world of Artificial Intelligence without getting tangled up in code? Would you love to understand how AI technologies are shaping the world, all explained in simple, accessible language?

Follow me on Medium and Twitter. I break down complex AI concepts, demystify the latest advancements, and share how these technologies are transforming various industries, all without requiring you to write a single line of code.

Also, Read

Follow our Social Accounts- Facebook/Instagram/Linkedin/Twitter

Join AImonks Youtube Channel to get interesting videos.

--

--

NoCode AI
š€šˆ š¦šØš§š¤š¬.š¢šØ

Understanding #AI tools with #nocode āš’ļø Instantly, turn your idea to App šŸš€