
In this lecture the overall plan for the course is discussed, as well as our approach for learning.
In this lecture we discuss how the ChatGPT API will allow us to access ChatGPT from within running programs written in C, and a number of related background concepts to ensure we understand how it works and how our C programs will access the ChatGPT API.
In this lecture we learn what tools and libraries will be required to build our applications in this course. In particular we will need a compiler, text editor, the cJSON library, and libcurl. After watching this lecture, students should watch one of the lecture videos below that is specific to setting up an environment for their operating system. Use the demo.zip code found in this lecture to test out if your environment is setup correctly.
In this lecture we cover how to setup a development environment on MacOS, which involves installing Visual Studio Code and Xcode Command Line Tools.
In this lecture we cover how to setup a development environment in Linux Ubuntu, which involves installing Visual Studio Code, gcc and libcurl. We also discuss how the steps may be performed slightly differently using different types of Linux.
One option to setup a development environment using Windows is to use MSYS2, which allows us to run the gcc compiler with libcurl in a Unix-like environment. In this lecture we go over how to install Visual Studio Code and MSYS2, and then how to install and use gcc and libcurl using MSYS2.
A second option to setup a development environment using Windows is to using a Linux Virtual Machine. In this lecture we go over how to setup a Linux Virtual Machine using VirtualBox and Ubuntu. After completing the steps in this video, you can then setup a development environment in the Linux Virtual Machine by watching the Linux Development Environment Setup lecture.
In this video we create the C library to use the ChatGPT API. We'll use this library for the rest of the projects we create together in this course.
Two versions of "starter code" for working on these projects are provided with this lecture: one in which the API key is "hardcoded" as a string literal in the C source code, and one in which the API key is accessed using an environment variable that must be set to the API key. Accessing the API key from an environment variable allows you to share your source code without also sharing your API key. If someone gets access to your API key they could use your account credit. A link to a website which covers how to set environment variables is provided with this lecture, and videos are posted overviewing how to set environment variables on MacOS, Windows and Linux.
In this lecture we learn how to setup environment variables in MacOS.
In this lecture we learn how to setup environment variables in Linux Ubuntu.
In this lecture we learn how to setup environment variables in Windows, assuming we've setup a development environment using MSYS2 as covered in this course.
In this lecture we create a fun fortune teller application together step-by-step. As part of this we also learn about building a prompt made up of multiple 'parts' as well as using random numbers in C.
In this lecture we create a fun joke generator application together step-by-step. As part of this we also learn about accepting user input and incorporating that user input into a prompt.
In this lecture we create a file summarizer utility application together step-by-step to summarize the contents of files. As part of this we also learn about reading file contents and using dynamic memory allocation to create prompts with a flexible length that is unknown until the program executes (i.e. runtime).
In this lecture we create a shell command creator utility application together step-by-step to create shell command(s) based on a written description of the task the user wants to accomplish.
In this lecture we create a shell command explainer utility application together step-by-step to provide explanations for how shell command(s) work. The application uses a loop to allow the user to continually provide shell command(s) to have them explained until they decide to quit.
In this lecture we create a quiz game together step-by-step to allow the user to play a quiz game based on any topic they choose. As part of this we also learn about using dynamic memory allocation, prompting ChatGPT multiple times and prompting ChatGPT to make a judgement one way or the other about the correctness of answers.
In this course, you’ll learn how to write C programs that connect to ChatGPT, send prompts, and use the responses from ChatGPT to create intelligent shell applications. You'll learn how to build powerful intelligent shell applications with real-world use cases, and these applications will also help you to build your software development portfolio, impress employers and stand out during interviews.
During the course we'll create 10 C applications together step-by-step, with every line of code explained. Sometimes we'll make something fun, like an interactive fantasy adventure story application where the story never ends. But most of the applications we'll create will solve a real problem. So for example, because using shell commands can be tricky, we'll make an application that generates shell command(s) given a plain-english written description of what the user wants to accomplish. We'll make other useful applications that do things like modify configuration files and generate mock data too!
OpenAI provides libraries for using ChatGPT with Python and other languages, but they don't provide a library for using ChatGPT with C. So one of the more interesting and fun things we'll do in the course is build our own simple C library for accessing ChatGPT. To build this library we'll learn about what's called a web API. Specifically we'll learn about the ChatGPT API, along with other concepts such as how to make HTTP requests and work with JSON data. All of these concepts are important to learn in general in computer programming. And along the way in this course we'll also get practical practice with C programming concepts like file access, dynamic memory allocation, and using command-line arguments.
So if you’re ready to learn how to supercharge your C applications with ChatGPT, take your C skills further, and create portfolio projects you'll be proud to show off, then enroll today, and let’s start building!