DEV Community

Cover image for Troubleshooting Flask Chatbot Application
Anthony
Anthony

Posted on

Troubleshooting Flask Chatbot Application

Image description

Introduction

Hi folks. I am troubleshooting something and am wondering if anyone can help out. I am a bit of a noob, but eager to learn and help others in their own projects. I can return the favor if you want someone to help with your own programs.

Intake Chatbot for Business

I am currently working on a Flask application chatbot to assist a business in carrying out various administrative tasks. I used Python for the backend** logic and Javascript for the frontend. I also have this all integrated with the Google ecosystem. The intention is for the chatbot to carry out a structured or unstructured interview, and then send the data to a Google Sheet. The Google Sheet also has several functionalities using Google Apps Scripts. Once I finish the code, I intend to embed it on a Wordpress site. I also think I could make simple tweaks to it and sell it to individual businesses for their own needs. Below are the features of the program.

  • Basic Chatbot UI to be deployed as a widget on a wordpress site
  • Carries out structured or unstructured interview
  • Makes various API calls specifically for Google Sheets, Gmail, Open AI etc
  • Google Apps Script sends data to Open AI for Summarization, Analysis and to write personalized emails
  • Google Apps Script also has function to automate email

Program Structure

The program utilizes Pytorch to carry out a more loose, unstructured interview, but for now I don't need this functionality and it is commented out. For now, I just have a structured interview written into the code with pre-set questions. There is a dictionary to store the question category responses and a step handler that moves on to the next step when it receives input. Then the idea is to take this information and append it to the Google Sheet

Troubleshooting

The program should work fine, but there is one hiccup. For whatever reason, the data is not appending to the Google Sheet, which is the final function and should be triggered by the last step. I have tested this function separately in a simpler program with hardcoded data and there doesn't appear to be any issue with my service account or API. Something is going wrong in the last step which should trigger the append to sheet function

Issues

Again, I am bit of a noob and must admit that I use ChatGPT as a bit of a crutch, so it is very possible the code is wretched.

Invitation for pointers

I have learned a lot during this project, but I am self-taught and there are a lot of gaps in my knowledge. If anyone wants to take a look at the code and give suggestions I would appreciate it and would certainly find a way to return the favor.

Cheers,

Tony  

Top comments (0)