Books+ Search Results

ChatGPT for Java A Hands-On Developer's Guide to ChatGPT and Open AI APIs

Title
ChatGPT for Java [electronic resource] : A Hands-On Developer's Guide to ChatGPT and Open AI APIs / Bruce Hopkins ; foreword by Patricia Thaine.
ISBN
9798868801167
9798868801150
Published
Berkeley, CA : Apress L. P., 2024.
Physical Description
1 online resource (243 p.)
Local Notes
Access is available to the Yale community.
Notes
Description based upon print version of record.
Request Body (Multipart Form Data)
Access and use
Access restricted by licensing agreement.
Summary
Embrace the future of software development! ChatGPT for Java is the perfect starting point for Java developers to learn how to build intelligent applications using ChatGPT and Open AI APIs. This book takes you from the ground up to demonstrate how to use ChatGPT programmatically. You will learn the basics of ChatGPT and OpenAI APIs, including how to authenticate, send prompts, generate responses, test in the Playground, and handle errors. Each chapter includes practical exercises which demonstrate different API functionalities and bring your concepts to life. You will learn how to AI-enable your own applications using models such as GPT-4, GPT-3.5, Whisper, DALL-E, and many more. As a result, developers will understand that generative AI tools will not replace software development jobs! Instead, you will leverage ChatGPT as your Java AI-pair programmer to increase speed and productivity. You will also learn how ChatGPT can provide powerful Natural Language Processing (NLP) capabilities to your Java apps in order to understand various formats of unstructured text. Step-by-step, you will apply the concepts covered to create your own intelligent chatbots that can automatically process messages from either Slack on Discord. With this book, Java developers will be empowered to take their applications to new heights by leveraging the power of AI as this exciting field continues to evolve and transform. What You Will Learn Authenticate with the ChatGPT and OpenAI APIs and learn how to engineer and send prompts Test your prompts in the ChatGPT Playground How to use multiple artificial intelligence models Harness the power the temperature, top_p, and other parameters that can ONLY be accessed by developers to create more unique and engaging responses from ChatGPT Create intelligent bots for Slack or Discord servers Incorporate context into prompts for betterresponses and apply advanced features of the APIs. Explore future directions for ChatGPT and OpenAI Who This Book Is For Beginning and intermediate Java developers who have a basic understanding of Java programming concepts and are interested in learning how to add intelligence to their applications by using ChatGPT programmatically. No prior experience with ChatGPT or OpenAI APIs is required.
Variant and related titles
O'Reilly Safari. OCLC KB.
Other formats
Print version: Hopkins, Bruce ChatGPT for Java Berkeley, CA : Apress L. P.,c2024
Format
Books / Online
Language
English
Added to Catalog
April 02, 2024
Contents
Intro
Table of Contents
About the Author
About the Technical Reviewer
Foreword
Chapter 1: Introducing ChatGPT for Java Developers
Who Is This Book For?
Chapter Overview
Download the Code Now!
So, What Exactly Is ChatGPT and Why Do I Need to Use the OpenAI APIs?
Regex vs. ChatGPT: Fight!
Analysis Question #1: Who Didn't Get Any Ice Cream and Why?
Analysis Question #2: Which Kid Was Probably Left Sad?
Let's Unlearn Some Words in Order to Learn More About the ChatGPT API
Models. Models? Models!!!
When We Talk About Tokens, Think About the StringTokenizer and Not Access Tokens
Temperature Is All About Creativity
Getting Started with the OpenAI Playground
1. System
2. User
3. Assistant (Optional)
4. Add Message (Optional)
5. View Code (Optional)
6. Model (Optional)
7. Temperature (Optional)
8. Maximum Length (Optional)
Try It Now! Experimenting with the "System" Role
Conclusion
Chapter 2: Using ChatGPT As Your Java Pair-Programmer
Creating Your First Java ChatGPT App: ListModels.java
List Models Endpoint
Creating the Request
Handling the JSON Response
Model (JSON)
Chat Endpoint
Creating the Request
Chat (JSON)
Handling the Response
Chat Completion (JSON)
Wait, How Many Tokens Are in My Prompt?
ChatGPT Token Counter
Creating the Next Java App: ChatGPTClient.java
Conclusion
Chapter 3: Using AI in the Enterprise! Creating a Text Summarizer for Slack Messages
So, What Is Prompt Engineering?
Updating ChatGPTClient.java (and Related Classes) with the Builder Pattern
ChatGPT Is Here to Take Away Everyone's Jobs (Not Really)
Examining a Real World Problem: Customer Support for a Software Company
Prompt Engineering 101: Text Summarization
Prompt #1: "tl
dr"
Prompt #2: "Explain This in 3 Sentences or Less"
Prompt #3: "I'm a Manager. Explain to Me What Happened"
Prompt #4: "Give Me Suggestions on Next Steps"
Let's Talk About Real Prompt Engineering
Registering a Slack Bot App
Specifying What Your Bot Can (and Can't) Do By Setting the Scope
Confirming Your Settings
Viewing the OAuth and Permissions Page
Installing Your Slack Bot App to Your Workspace
Getting Your Slack Bot (Access) Token
Inviting Your Bot to Your Channel
Finding the Channel ID of Your Channel
Using Your Slack Bot App to Automatically Grab Messages from a Channel
Setting Up Your Dependencies
Programmatically Reading Messages from Slack with ChannelReaderSlackBot.java
Exercises Left for the Reader
Conclusion
Chapter 4: Multimodal AI: Creating a Podcast Visualizer with Whisper and DALL·E 3
Introducing the Whisper Model by OpenAI
Features and Limitations of the Whisper Model
Transcriptions Endpoint
Creating the Request
Also listed under
Citation

Available from:

Online
Loading holdings.
Unable to load. Retry?
Loading holdings...
Unable to load. Retry?