Developing Apps with GPT-4 and ChatGPT: Build Intelligent Chatbots, Content Generators, and More

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This minibook is a comprehensive guide for Python developers who want to learn how to build applications with large language models. Authors Olivier Caelen and Marie-Alice Blete cover the main features and benefits of GPT-4 and ChatGPT and explain how they work. You'll also get a step-by-step guide for developing applications using the GPT-4 and ChatGPT Python library, including text generation, Q&A, and content summarization tools. Written in clear and concise language, Developing Apps with GPT-4 and ChatGPT includes easy-to-follow examples to help you understand and apply the concepts to your projects. Python code examples are available in a GitHub repository, and the book includes a glossary of key terms. Ready to harness the power of large language models in your applications? This book is a must. You'll learn: • The fundamentals and benefits of ChatGPT and GPT-4 and how they work • How to integrate these models into Python-based applications for NLP tasks • How to develop applications using GPT-4 or ChatGPT APIs in Python for text generation, question answering, and content summarization, among other tasks • Advanced GPT topics including prompt engineering, fine-tuning models for specific tasks, plug-ins, LangChain, and more

Author(s): Olivier Caelen, Marie-Alice Blete
Edition: 1
Publisher: O’Reilly Media
Year: 2023

Language: English
Commentary: Publisher's PDF
Pages: 157
City: Sebastopol, CA
Tags: Machine Learning; Natural Language Processing; Python; ChatGPT; GPT-4; Prompt Design; LangChain

Cover
Copyright
Table of Contents
Preface
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
Acknowledgments
Chapter 1. GPT-4 and ChatGPT Essentials
Introducing Large Language Models
Exploring the Foundations of Language Models and NLP
Understanding the Transformer Architecture and Its Role in LLMs
Demystifying the Tokenization and Prediction Steps in GPT Models
A Brief History: From GPT-1 to GPT-4
GPT-1
GPT-2
GPT-3
From GPT-3 to InstructGPT
GPT-3.5, Codex, and ChatGPT
LLM Use Cases and Example Products
Be My Eyes
Morgan Stanley
Khan Academy
Duolingo
Yabble
Waymark
Inworld AI
Beware of AI Hallucinations: Limitations and Considerations
Optimizing GPT Models with Plug-ins and Fine-Tuning
Summary
Chapter 2. A Deep Dive into the GPT-4 and ChatGPT APIs
Essential Concepts
Models Available in the OpenAI API
Trying GPT Models with the OpenAI Playground
Getting Started: The OpenAI Python Library
OpenAI Access and API Key
“Hello World” Example
Using ChatGPT and GPT-4
Input Options for the Chat Completion Endpoint
Output Result Format for the Chat Completion Endpoint
From Text Completions to Functions
Using Other Text Completion Models
Input Options for the Text Completion Endpoint
Output Result Format for the Text Completion Endpoint
Considerations
Pricing and Token Limitations
Security and Privacy: Caution!
Other OpenAI APIs and Functionalities
Embeddings
Moderation Model
Whisper and DALL-E
Summary (and Cheat Sheet)
Chapter 3. Building Apps with GPT-4 and ChatGPT
App Development Overview
API Key Management
Security and Data Privacy
Software Architecture Design Principles
LLM-Powered App Vulnerabilities
Analyzing Inputs and Outputs
The Inevitability of Prompt Injection
Example Projects
Project 1: Building a News Generator Solution
Project 2: Summarizing YouTube Videos
Project 3: Creating an Expert for Zelda BOTW
Project 4: Voice Control
Summary
Chapter 4. Advanced GPT-4 and ChatGPT Techniques
Prompt Engineering
Designing Effective Prompts
Thinking Step by Step
Implementing Few-Shot Learning
Improving Prompt Effectiveness
Fine-Tuning
Getting Started
Fine-Tuning with the OpenAI API
Fine-Tuning Applications
Generating and Fine-Tuning Synthetic Data for an Email Marketing Campaign
Cost of Fine-Tuning
Summary
Chapter 5. Advancing LLM Capabilities with the LangChain Framework and Plug-ins
The LangChain Framework
Dynamic Prompts
Agents and Tools
Memory
Embeddings
GPT-4 Plug-ins
Overview
The API
The Plug-in Manifest
The OpenAPI Specification
Descriptions
Summary
Conclusion
Glossary of Key Terms
Index
About the Authors
Colophon