Code, Tutorials and Hacks
A GPT-3 chatbot is a software application that is able to conduct a conversation with a human user through written or spoken language. The level of “intelligence” among chatbots varies greatly. While some chatbots have a fairly basic understanding of language, others employ sophisticated artificial intelligence (AI) and machine learning (ML) algorithms to achieve an almost human conversational level.
In this tutorial I’m going to show you how easy it is to build a chatbot for Twilio SMS using the OpenAI platform and the Flask framework for Python.
Want to have an idea of what the capabilities of GPT-3 are? Take a look at the following interaction I had with this bot using the project we are going to build in this tutorial:
Introduction to GPT-3
GPT-3 (Generative Pre-trained Transformer 3) is a highly advanced language model trained on a very large corpus of text. In spite of its internal …
There are quite a few cases in an application when you want to trigger notifications to users on database changes. One of the most common examples would be updates to feeds. When a new web feed arrives in your database you would want to send a notification to your users regarding this feed.
Usually, in an application, you might trigger an event after storing the feed in your database, which will asynchronously send a notification to your users. But is that the best solution available out there? Wouldn’t it be a lot better if you could send messages automatically when a document is created or updated in a collection, thus separating it from your business logic?
Often referred to as a platform or programming language agnostic query language, GraphQL is a comprehensive approach to guide software engineers in building data-driven applications. It is, in my opinion, the new API standard, offering client applications the flexibility to request exact data and not an entire record from the database. If you are not yet conversant with this technology or looking for simplified technical content to guide you through, you are in the right place.
In this tutorial, you will learn some of the fundamental concepts required to build a Laravel API powered by GraphQL. This is a shift from the conventional architecture of building REST APIs, as we will take a different approach in this tutorial. To help us explore GraphQL, we will build a bookstore API with an ability to carry out CRUD ( Create, Read, Update, Delete ) operations on data, in your database.
Surveys serve as a great tool for gathering information from a sample of people and can take multiple forms but are most common in the form of a questionnaire, either written, online or over the phone.
In this tutorial, I’m going to walk us through how to build an automated Phone Survey System which is a form of an Interactive voice response (IVR) system. An IVR system is a technology that allows a computer to interact with humans through the use of voice and DTMF tone input via the phone’s keypad. To build this application, I will be working with the Twilio Python Helper Library, the Flask framework for Python and Google Sheets. Below is a high-level overview of how the application works:
For the purpose of building this application, I have selected the following three questions to include in the survey:
- Do you own or rent a house? …
Often it doesn’t matter when a Promise returns data and the members of a collection of Promises can be resolved independently without regard to timing. A function can perform asynchronous tasks that don’t depend on the data from, or the success of, other asynchronous tasks.
But sometimes business rules or program design require that asynchronous actions are dependent on other asynchronous operations. For example:
- Establishing a remote database connection must be preceded by loading configuration information from the file system.
- Performing a REST API call to a weather API must be preceded by obtaining the user’s location from …
We've seen how to build a conference line and then protect it with a static passcode. However, passcodes can be guessed or leaked, especially if they are reused over time. An alternative is to make a list of numbers that are permitted to join the call. But, since spoofing phone numbers is relatively easy, this still may not protect you.
A one-time passcode (OTP) sent to a caller's phone or email, can verify they are who they say they are and increase the security of your conference line once more.
In this post we will take the Rails application we previously developed and add a conference line secured in two ways. We will:
- Ensure that the caller is a known participant by checking their caller ID against a list of permitted phone numbers
- Send them an OTP using Twilio Verify which they then have to enter correctly to ensure …
Twilio Programmable Messaging makes it easy to embed images in text messages, but a notable omission in the list of supported formats is Scalable Vector Graphics (SVG). While SVG is not one of the most popular image formats, it is the preferred choice for generating diagrams and charts, because this format renders without quality degradation at any resolution.
So what do you do if you have an SVG image and need to send it via SMS or WhatsApp? In this article I will show you how I use the CairoSVG package for Python to convert SVG images to the PNG format, which the messaging APIs support.
The only requirement that you need for this tutorial is Python 3.6 or newer. If your operating system does not provide a Python interpreter, you can go to python.org to download an installer.
Let’s begin by creating a directory …
Airflow is an open source platform used to orchestrate workflows. It is perfect for Extract, Transform, Load tasks, data migration and data integration, among other jobs.
In this tutorial we will see how we can leverage Twilio’s Programmable Messaging to set up an alerting system for Airflow jobs.
Airflow DAG (source: Apache Airflow)
To follow this tutorial you need to have:
- Git. See installation instructions here.
- Docker. You can follow the installation steps provided here.
- A Twilio account. If you are new to Twilio create a free account now. You can review the features and limitations of a free Twilio account.
Set up Airflow to run locally
We are going to start off by cloning a repository that contains the docker image we shall use for this tutorial. The image is based on Python 3.7-slim-buster and will create Postgres and Redis containers. Postgres is …
Time is a commodity that can’t be purchased but, if managed well, you can free up time to spend on the things you love. According to an article by Dorie Clark of Duke University in the Harvard Business Review, tracking your time can give you a better overview of how you spend your time during the week.
You might realize that you’re spending too much time during the week on meetings. If you are curious to learn exactly how much time — even if you dread the answer — this post is for you!
In the tutorial that follows you’ll learn how to pull the details of your meetings from your Google Calendar using the Google Calendar API. Then you’ll use Twilio Programmable SMS to send yourself a weekly text message with the total for the previous week.
You’ll also learn how to use n8n (pronounced “nodemation”) to create …
You might have reached the point in your career where you ask yourself the question, “should I invest in a personal domain name?” If you are a young professional who owns a GitHub page for their portfolio and is looking to build their online presence, then the answer is “yes!” It is absolutely time to build your digital brand.
Follow along this journey to learn how to quickly redirect your GitHub Pages site (normally located at your username.github.io) to your custom domain name in less than 10 minutes! Get ready to impress people by sharing a newly accessible URL to showcase your interests and hackathon projects.
- A GitHub repository with static files for your personal site. If you’re reading this, you might already have a functional portfolio site hosted on a GitHub page with a free github.io domain name but want to change your domain name. You do …