Building AI Applications with ChatGPT APIs

Book description

Enhance your application development skills by building a ChatGPT clone, code bug fixer, quiz generator, translation app, email auto-reply, PowerPoint generator, and more in just one read!

Key Features

  • Become proficient in building AI applications with ChatGPT, DALL-E, and Whisper
  • Understand how to select the optimal ChatGPT model and fine-tune it for your specific use case
  • Monetize your applications by integrating the ChatGPT API with Stripe
  • Purchase of the print or Kindle book includes a free PDF eBook

Book Description

Combining ChatGPT APIs with Python opens doors to building extraordinary AI applications. By leveraging these APIs, you can focus on the application logic and user experience, while ChatGPT’s robust NLP capabilities handle the intricacies of human-like text understanding and generation.

This book is a guide for beginners to master the ChatGPT, Whisper, and DALL-E APIs by building ten innovative AI projects. These projects offer practical experience in integrating ChatGPT with frameworks and tools such as Flask, Django, Microsoft Office APIs, and PyQt.

Throughout this book, you’ll get to grips with performing NLP tasks, building a ChatGPT clone, and creating an AI-driven code bug fixing SaaS application. You’ll also cover speech recognition, text-to-speech functionalities, language translation, and generation of email replies and PowerPoint presentations. This book teaches you how to fine-tune ChatGPT and generate AI art using DALL-E APIs, and then offers insights into selling your apps by integrating ChatGPT API with Stripe. With practical examples available on GitHub, the book gradually progresses from easy to advanced topics, cultivating the expertise required to develop, deploy, and monetize your own groundbreaking applications by harnessing the full potential of ChatGPT APIs.

What you will learn

  • Develop a solid foundation in using the ChatGPT API for natural language processing tasks
  • Build, deploy, and capitalize on a variety of desktop and SaaS AI applications
  • Seamlessly integrate ChatGPT with established frameworks such as Flask, Django, and Microsoft Office APIs
  • Channel your creativity by integrating DALL-E APIs to produce stunning AI-generated art within your desktop applications
  • Experience the power of Whisper API's speech recognition and text-to-speech features
  • Discover techniques to optimize ChatGPT models through the process of fine-tuning

Who this book is for

With best practices, tips, and tricks for building applications using the ChatGPT API, this book is for programmers, entrepreneurs, and software enthusiasts. Python developers interested in AI applications involving ChatGPT, software developers who want to integrate AI technology, and web developers looking to create AI-powered web applications with ChatGPT will also find this book useful. A fundamental understanding of Python programming and experience of working with APIs will help you make the most of this book.

Table of contents

  1. Building AI Applications with ChatGPT APIs
  2. Contributors
  3. About the Author
  4. About the Reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Get in touch
    6. Share Your Thoughts
    7. Download a free PDF copy of this book
  6. Part 1:Getting Started with OpenAI APIs
  7. Chapter 1: Beginning with the ChatGPT API for NLP Tasks
    1. Technical Requirements
    2. The ChatGPT Revolution
    3. Using ChatGPT from the Web
      1. Creating an OpenAI Account
      2. ChatGPT Web Interface
    4. Getting Started with the ChatGPT API
      1. Obtaining an API Key
      2. API Tokens and Pricing
    5. Setting Up Your Python Development Environment
      1. Installing Python and the PyCharm IDE
      2. Setting Up a Python Virtual Environment
      3. The pip Package Installer
      4. Building a Python Virtual Environment from the Terminal
    6. A Simple ChatGPT API Response
    7. Summary
  8. Chapter 2: Building a ChatGPT Clone
    1. Technical Requirements
    2. Creating a ChatGPT Clone with Flask
    3. Frontend HTML Generation
    4. Enhancing the ChatGPT Clone Design
    5. Intercepting ChatGPT API Endpoints
    6. Summary
  9. Part 2: Building Web Applications with the ChatGPT API
  10. Chapter 3: Creating and Deploying an AI Code Bug Fixing SaaS Application Using Flask
    1. Technical Requirements
    2. Performing Multiple ChatGPT API Requests
    3. Setting Up the Code Bug Fixer Project
    4. Implementing the Code Bug Fixer Backend
    5. Using Text Areas and Containers
    6. Testing the Code Bug Fixer App
    7. Deploying the ChatGPT App to the Azure Cloud
    8. Summary
  11. Chapter 4: Integrating the Code Bug Fixer Application with a Payment Service
    1. Technical Requirements
    2. Integrating Payments with Stripe
    3. Setting Up a SQL User Database
      1. Initializing a SQL Database
      2. Getting a Browser Fingerprint ID
      3. Tracking Application Users
      4. Implementing the Usage Counters
    4. Adding Payments to a ChatGPT Application
      1. Building the Payments Page
      2. Confirming User Payments
    5. Summary
  12. Chapter 5: Quiz Generation App with ChatGPT and Django
    1. Technical Requirements
    2. Building a Django Project
    3. Creating the Exam App Frame and Views
      1. Connecting Django Views and URLs
      2. Developing Django Templates
      3. Running Your Django Application
    4. Integrating ChatGPT and Django for Quiz Generation
      1. Building the Quiz Generation Text Area and Submit Button
      2. Creating ChatGPT API Views with Django
    5. Storing and Downloading Generated Quizzes
      1. Saving the Quizzes in an SQLite Database
      2. Building the Download Quiz View
      3. Designing the Download Template
    6. Summary
  13. Part 3: The ChatGPT, DALL-E, and Whisper APIs for Desktop Apps Development
  14. Chapter 6: Language Translation Desktop App with the ChatGPT API and Microsoft Word
    1. Technical Requirements
    2. Integrating ChatGPT API with Microsoft Office
    3. Building a User Interface with Tkinter
    4. Integrating Microsoft Word Text with the ChatGPT API
      1. Translating a Word Text with ChatGPT 3.5 Turbo
    5. Summary
  15. Chapter 7: Building an Outlook Email Reply Generator
    1. Technical Requirements
    2. Passing Outlook Data to the ChatGPT API
      1. Setting Up the Outlook Email
      2. Accessing Email Data with the win32com Client
      3. Generating automatic email replies
    3. Summary
  16. Chapter 8: Essay Generation Tool with PyQt and the ChatGPT API
    1. Technical Requirements
    2. Building a Desktop Application with PyQT
      1. Setting Up the Essay Generation Tool Project
      2. Building the Application GUI with PyQt
    3. Creating Essay Generation Methods with the ChatGPT API
    4. Controlling the ChatGPT API Tokens
    5. Summary
  17. Chapter 9: Integrating ChatGPT and DALL-E API: Build End-to-End PowerPoint Presentation Generator
    1. Technical Requirements
    2. Using DALL-E and the DALL-E API
    3. Building PowerPoint Apps with the PPTX Python Framework
    4. Generating Art with the DALL-E API
    5. Finalizing and Testing the AI Presentation Generator
    6. Summary
  18. Chapter 10: Speech Recognition and Text-to-Speech with the Whisper API
    1. Technical Requirements
    2. Implementing Text Translation and Transcription with the Whisper API
    3. Building a Voice Transcriber Application
    4. Using PyDub for Longer Audio Inputs
    5. Summary
  19. Part 4:Advanced Concepts for Powering ChatGPT Apps
  20. Chapter 11: Choosing the Right ChatGPT API Model
    1. Technical Requirements
    2. ChatGPT API Models – GPT-3, GPT-4, and Beyond
    3. Using Chat Completion Parameters
    4. ChatGPT API Rate Limits
    5. Summary
  21. Chapter 12: Fine-Tuning ChatGPT to Create Unique API Models
    1. Technical Requirements
    2. Fine-Tuning ChatGPT
    3. Fine-Tuned Model Dataset Preparation
    4. Building and Using the Fine-Tuned Model
    5. Summary
  22. Index
    1. Why subscribe?
  23. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Download a free PDF copy of this book

Product information

  • Title: Building AI Applications with ChatGPT APIs
  • Author(s): Martin Yanev
  • Release date: September 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781805127567