Como Integrar ChatGPT com WhatsApp Sem Assinar Aplicativo

Como Integrar ChatGPT com WhatsApp Sem Assinar Aplicativo

Introduction and Greeting

The speaker greets the audience and expresses their intention to make the day more positive and joyful. They acknowledge a specific channel's viewers and express confidence in their talent and creativity.

Greeting and Positive Vibes

  • The speaker greets the audience with enthusiasm.
  • They mention a specific channel, "Inteligência Mil Grau," and send greetings to its viewers.
  • The speaker expresses hope that everyone is doing well and excited for another day of amazing content.

Integration with WhatsApp

The speaker introduces the integration of ChatGPT with WhatsApp. They explain that this video will cover a complex topic, but they will break it down step by step.

Integration with ChatGPT

  • The speaker mentions integrating ChatGPT with WhatsApp.
  • They acknowledge the complexity of this topic but assure that they will explain it gradually.
  • A message sent from WhatsApp goes to Facebook, then to Glitch (a tool), which processes the data before sending it back to Facebook, which finally responds to WhatsApp.

Testing Echo Functionality

The speaker explains the concept of an "echo" test where messages are sent back as responses. This serves as an initial test for the integration process.

Echo Test Process

  • The speaker describes how an echo test works by sending a message from WhatsApp, which is then echoed back as a response.
  • They explain that this process involves communication between WhatsApp, Facebook, Glitch, and back to WhatsApp.

Sending Questions and Receiving Responses

The speaker discusses sending questions from WhatsApp to Facebook through Glitch. Glitch forwards these questions to ChatGPT, which responds and sends the answer back to Facebook, which then forwards it to WhatsApp.

Question-Response Process

  • The speaker explains the process of sending a question from WhatsApp to Facebook through Glitch.
  • Glitch forwards the question to ChatGPT, which generates a response.
  • The response is sent back to Facebook, which then forwards it to WhatsApp.

Authorization Process

The speaker emphasizes the need for authorization from Facebook in order to send and receive messages. They explain that an initial authorization process is required.

Authorization Steps

  • The speaker mentions the importance of obtaining authorization from Facebook for message sending and receiving.
  • They explain that an initial authorization process needs to be completed.
  • Instructions are given on how to create an app on Facebook's website and obtain necessary credentials.

Creating an App on Facebook

The speaker guides viewers through creating an app on Facebook's platform. They demonstrate how to register and provide necessary details for the app.

App Creation Process

  • Viewers are instructed to visit facebook.com/deviller and create their own account.
  • Detailed steps are provided for creating an app, including entering personal information and configuring settings.
  • A Business account is recommended for receiving responses, while a test version can be used without one.

Configuring App Settings

The speaker explains how to configure settings for the created app on Facebook's platform. This includes adding emails, setting up a Business account if applicable, and other relevant configurations.

Configuring App Settings

  • Viewers are guided through configuring various settings for their app on the Facebook platform.
  • Instructions include adding emails associated with the app and setting up a Business account if desired.
  • The speaker emphasizes the importance of having a Business account for receiving responses.

Creating a WhatsApp Application

The speaker explains how to create a WhatsApp application within the Facebook app. This involves naming the app, providing necessary details, and configuring webhooks for communication between Facebook and Glitch.

Creating a WhatsApp Application

  • Viewers are instructed to search for "WhatsApp" within their created app on Facebook's platform.
  • Automatic creation of a WhatsApp-related component is demonstrated.
  • The concept of webhooks (communication between applications) is introduced, specifically in relation to Facebook and Glitch.

Setting Up an Echo Bot

The speaker explains how to set up an echo bot using either Glitch or AWS Lambda. They share their preference for using Glitch due to its simplicity.

Setting Up an Echo Bot

  • Two options are presented for setting up an echo bot: using Glitch or AWS Lambda.
  • The speaker expresses a preference for Glitch due to its simplicity and provides instructions accordingly.

Remixing the Glitch Project

The speaker demonstrates remixing the Glitch project as part of setting up the echo bot. They guide viewers through editing variables and obtaining access tokens.

Remixing the Glitch Project

  • Viewers are guided through remixing the Glitch project related to their echo bot setup.
  • Instructions include editing variables such as WhatsApp token and verify token.
  • Access tokens are obtained from Facebook during this process.

Accessing App Settings on Facebook

The speaker explains how to access app settings on Facebook's platform after completing previous steps. They highlight important features like adding products and accessing WhatsApp quick start.

Accessing App Settings

  • Viewers are instructed to access app settings on the Facebook platform.
  • The speaker mentions the option of adding products if desired.
  • Instructions are given for accessing the WhatsApp quick start feature.

Authorization Configuration

The speaker explains the process of configuring authorization within app settings on Facebook's platform. They demonstrate copying an access token required for further steps.

Authorization Configuration

  • The speaker instructs viewers to configure authorization within app settings on Facebook's platform.
  • An access token is copied from this configuration, which will be used in subsequent steps.

Remixing Glitch and Creating Variables

The speaker guides viewers through remixing the Glitch project again and creating variables necessary for integration with WhatsApp.

Remixing Glitch and Variable Creation

  • Viewers are guided through remixing the Glitch project once more.
  • Instructions include creating variables such as WhatsApp token and verify token.
  • These variables are essential for integrating with WhatsApp.

Setting up the WhatsApp Token

In this section, the speaker discusses setting up the WhatsApp token and shares their opinion on it.

Setting Up the Token

  • The speaker mentions that they have already applied the WhatsApp token and will share their application in the link provided.
  • They explain that their application is slightly different from the original example but will have a similar version.
  • The speaker suggests following the provided instructions to set up the token for "Glitter The Burger" project.

Differences in Application

Here, the speaker explains some differences in their application compared to the original example.

Application Differences

  • The speaker mentions that they have already tested and applied their version of the application.
  • They state that their version includes "use stricks" and a chat GPT feature.
  • However, they mention that if using a specific version on Remix of EDGE, there is no need to add the chat GPT feature separately.

Verifying Token Configuration

In this section, the speaker explains how to verify token configuration for proper setup.

Verifying Token

  • The first step is to perform verification of the web hook by using Web Hulk.
  • To verify, go to configuration settings and select "Verify Token."
  • Copy and paste the address seen in Zap into Web Hulk's field with "/webhulk" added at the end.
  • Enter "verify token Bob rap" as shown in configuration settings.
  • Click on "Verify and Save." If successful, an OK message will appear. If not, make necessary adjustments until it works.

Configuring Messenger

Here, instructions are given on configuring Messenger for the application.

Configuring Messenger

  • After successful token verification, click on "Manage" and select "Messenger."
  • It is recommended to enable at least the Messenger option, but other options can be selected based on preferences.
  • Click on "Conclude" to complete the configuration process.

Setting Up Chat GPT

In this section, the speaker explains how to set up Chat GPT for the application.

Setting Up Chat GPT

  • The speaker sets the chat PT (Chat GPT) feature as "false," indicating that it will only provide an echo response.
  • They then change it to "true," which automatically loads conversations and enables interaction with Chat GPT.
  • The speaker demonstrates that no additional saving or clicking is required for this setup.

Testing Application Functionality

Here, the speaker tests the functionality of the application.

Testing Application

  • The speaker sends a message saying "Bom dia" (Good morning).
  • The application responds with a greeting and asks how it can help.
  • A sample conversation is shown where questions are asked and answered by the application using Web Hulk and Chat GPT functionalities.

Understanding Web Hulk Functions

In this section, the speaker explains different functions of Web Hulk in detail.

Web Hulk Functions

  • Web Hulk has three main functions: web hook listening, post request handling, and get request handling.
  • If web hook listening does not appear, there may be an issue with its functionality.
  • Post request handling is used when receiving messages. It processes requests and sends them to Chat GPT if necessary.
  • Get request handling is used for initial verification purposes only.

Understanding Chat GPT Integration

Here, the speaker explains how Chat GPT is integrated into the application.

Chat GPT Integration

  • When a message is received, it goes through request handling and is sent to Chat GPT if chat PT is set to "true."
  • If chat PT is set to "false," only an echo response will be sent.
  • The speaker emphasizes that this integration allows for updating WhatsApp conversations using Facebook's API.

OpenAI Key Configuration

In this section, the speaker discusses configuring the OpenAI key for the application.

OpenAI Key Configuration

  • The speaker mentions importing the OpenAI key and provides a video link explaining where to find it.
  • They explain that their code includes UOL instead of Facebook's code, so they have an additional line for configuration.
  • The OpenAI key should be placed in the appropriate location in the code.

Using ChatGPT 3.5

Here, the speaker explains why they use ChatGPT 3.5 instead of version 4 and demonstrates its usage.

Using ChatGPT 3.5

  • The speaker advises against using version 4 due to its high cost.
  • They mention sending a message in System explaining their chatbot's functionality and positive attitude.
  • A sample conversation shows how messages are sent and received between Web Hulk, Chat GPT, and WhatsApp.

This summary covers specific sections of the transcript as requested.

New Section

The transcript discusses the process of receiving and responding to a text message using a token. If the response is not from ChatGPT, the text field remains unchanged. If it is from ChatGPT, the response is updated and sent back.

Receiving and Responding to Text Messages

  • When a text message is received, it is checked if it is from ChatGPT or not.
  • If the message is not from ChatGPT, the text field remains unchanged.
  • If the message is from ChatGPT, the response is updated with what ChatGPT suggests.
  • In case of an error or if ChatGPT doesn't know how to respond, a default apology message is sent.

New Section

This section explains what happens when there are errors or uncertainties in responding to a text message.

Handling Errors and Uncertainties

  • If there's an error while processing the message, an apology message is sent.
  • If ChatGPT doesn't know how to respond or gets confused, it asks for clarification by requesting to repeat the same text again.
  • The system checks if the "send" variable equals false. If so, it sends an apology message asking for repetition of the original text.

The language used in this section matches that of the transcript provided.

Video description

Como fazer a integração entre o ChatGPT e o WhatsApp. Neste vídeo, mergulharemos na complexidade dessa integração e explicaremos passo a passo como configurar e autorizar o envio de mensagens do WhatsApp. Para realizar essa integração, precisamos obter autorização do Facebook. Será necessário criar um aplicativo no Facebook Developers e configurar as permissões adequadas. No tutorial, compartilho o processo de criação do aplicativo e a obtenção do token de acesso temporário. Em seguida, utilizamos o Glitch como plataforma para criar um "Eco Bot", ou seja, um bot que responde com a mesma mensagem recebida. Ao seguir as instruções fornecidas, você poderá criar seu próprio aplicativo e configurar as chaves de acesso no Glitch. Essa configuração permitirá que o Glitch se comunique com o WhatsApp e o Facebook, facilitando a troca de mensagens entre eles. Uma vez configurado, você poderá enviar mensagens para o WhatsApp e receber respostas através do Facebook. No vídeo, explico detalhadamente o passo a passo necessário para realizar essa integração. Também compartilho o código-fonte e disponibilizo um link para o tutorial completo. Ao final do vídeo, você terá uma compreensão clara de como configurar a integração entre o ChatGPT e o WhatsApp, abrindo possibilidades incríveis para interações com seus seguidores. Código do Glitch: https://glitch.com/edit/#!/zap-dialog Explicação do Eco Bot: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/set-up-whatsapp-echo-bot/ Redes Sociais: Site: www.inteligenciamilgrau.com Instagram: @inteligenciamilgrau facebook: https://www.facebook.com/inteligenciamilgrau GitHub: https://github.com/inteligenciamilgrau