• WordPress Chatbot

    Posted by Paul Singh on December 26, 2024 at 10:47 pm

    Hi Guys,

    I was having an issue trying to load the chatbot that Hasan had created a video on, but for some reason the code seems to be a little different from the video and not sure if everything works properly or I am doing something wrong.

    Can anyone assist.

    Hasan replied 3 hours, 26 minutes ago 4 Members · 15 Replies
  • 15 Replies
  • Hasan

    Administrator
    December 27, 2024 at 8:42 am

    Hi Paul, can you please share more details about the problem and which video you are referring to?

  • Paul Singh

    Member
    December 27, 2024 at 5:47 pm

    So I was trying out the chatbot with the ability to add AI tomato the chatbot mire robust. Then I saw your RAG chatbot which I was going to try but got a little confused which would actually work best for me. So the current problem is as follows.

    I added the code snippets and tries to load it to just a new page to test things out and here is what I get.

  • Husein

    Administrator
    December 27, 2024 at 6:45 pm

    The first code snippet is a javascript code so make sure to write <script> on the first line before everything and </script> on the last line after everything.

  • Paul Singh

    Member
    December 27, 2024 at 9:39 pm

    Thank you for the input. I think the problem could be a bit bigger than I initially though but determined to figure this out. The first thing I did was try and test the bot out and noticed it was offline, so I changed line 93 to 1 to have the bot active but it still has not activated so I cannot test if it is actually working before I create the snippets.

    I have gone ahead to see if by adding the snippets if they work on my site but noticed that the integration worked correctly but the bot is not online.

    Hasan do you know what I could have dont incorrectly?

    I guess once I get this sorted I will see how I can integrate RAG or ChatGPT to answer potential questions.

    • Husein

      Administrator
      December 28, 2024 at 6:52 am

      Did you edit everything in your code as Hasan mentioned in the tutorial like putting your own OpenAI API key, your site URL in the javascript variables, activated the PHP snippets when updating them, and so on?

      • Paul Singh

        Member
        December 29, 2024 at 1:27 am

        Hi Husein,

        I am a newbie but Im pretty sure I got all of the code in correctly. I added the code snippet from the config.php file and made sure I selected php.

        I then added the other three files and made sure I added <script> and </script> when adding the script file and <style> and </style> to the style file.

        <font face=”inherit”>I also </font>changed<font face=”inherit”> the ‘botstatus’ to 1 to </font>activate<font face=”inherit”> but for some reason the bot is not </font>surfing<font face=”inherit”> active nor do the buttons populate at the bottom of the chat for quick reference. </font>

        <font face=”inherit”>Obviously I am doing something wrong. lol </font>

        • Husein

          Administrator
          December 29, 2024 at 8:20 am

          Please dont share your API keys like this, people would use them and ud pay for every call, so make sure to deactivate this key and generate a new one.
          Anyways attach all your codes so that i can test them from my side and see whats wrong.

          • Paul Singh

            Member
            December 30, 2024 at 8:46 pm

            Hi Husein,

            Attached are the codes I have loaded for the front end. I hope this is what you were asking for.

            This file was truncated for preview. Please download to view the full file.
            • Paul Singh

              Member
              December 31, 2024 at 5:00 pm

              Hi Husein

              I received a post with front and back end codes but cannot see where is has been uploaded for me to download.

            • Husein

              Administrator
              January 1, 2025 at 4:51 pm

              I uploaded them but they didnt open correctly, i don’t know why so i deleted it.

              Please attach your email so that i can send them by email.

            • Paul Singh

              Member
              January 1, 2025 at 6:07 pm

              Hi Husein

              My email is pssawhney@yahoo.com.

  • Gerhard Liebenberg

    Member
    December 28, 2024 at 7:01 pm

    Hi Guys, I am also looking for the RAG code that was said to be included in a newsletter (according to this article: https://learnwithhasan.com/blog/free-ai-chatbot-on-wordpress/)

Log in to reply.