[AI] Hopkins Bruce / Хопкинс Брюс - ChatGPT for Java: A Hands-on Developer's Guide to ChatGPT and Open AI APIs / ChatGPT для Java: Практическое руководство разработчика по ChatGPT и Open AI API [2024, PDF, ENG]

Страницы:  1
Ответить
 

tsurijin

Стаж: 5 лет 1 месяц

Сообщений: 2991


tsurijin · 28-Фев-24 10:21 (1 год 9 месяцев назад, ред. 28-Фев-24 10:23)

ChatGPT for Java: A Hands-on Developer's Guide to ChatGPT and Open AI APIs / ChatGPT для Java: Практическое руководство разработчика по ChatGPT и Open AI API
Год издания: 2024
Автор: Hopkins Bruce / Хопкинс Брюс
Издательство: A press Media
ISBN: 979-8-8688-0116-7
Язык: Английский
Формат: PDF
Качество: Отсканированные страницы + слой распознанного текста
Количество страниц: 243
Описание: 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 better responses 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.
Откройте для себя будущее разработки программного обеспечения! ChatGPT для Java - это идеальная отправная точка для разработчиков Java, чтобы научиться создавать интеллектуальные приложения с использованием ChatGPT и открытых API искусственного интеллекта.
В этой книге вы узнаете с нуля, как программно использовать ChatGPT. Вы изучите основы API-интерфейсов ChatGPT и OpenAI, в том числе как проходить аутентификацию, отправлять приглашения, генерировать ответы, тестировать на игровой площадке и обрабатывать ошибки. Каждая глава включает практические упражнения, которые демонстрируют различные функциональные возможности API и воплощают ваши концепции в жизнь. Вы узнаете, как включать искусственный интеллект в свои собственные приложения, используя такие модели, как GPT-4, GPT-3.5, Whisper, DALL-E и многие другие.
В результате разработчики поймут, что инструменты генеративного искусственного интеллекта не заменят работу по разработке программного обеспечения! Вместо этого вы будете использовать ChatGPT в качестве программиста Java AI-pair для повышения скорости и производительности. Вы также узнаете, как ChatGPT может предоставить вашим Java-приложениям мощные возможности обработки естественного языка (NLP) для понимания различных форматов неструктурированного текста. Шаг за шагом вы будете применять описанные концепции для создания своих собственных интеллектуальных чат-ботов, которые могут автоматически обрабатывать сообщения как из Slack, так и из Discord.
Благодаря этой книге разработчики Java смогут поднять свои приложения на новые высоты, используя возможности искусственного интеллекта, поскольку эта захватывающая область продолжает развиваться и трансформироваться.
Что вы узнаете:
Пройдите аутентификацию с помощью API-интерфейсов ChatGPT и OpenAI и узнаете, как создавать и отправлять приглашения
Протестируйте свои подсказки на игровой площадке ChatGPT
Как использовать несколько моделей искусственного интеллекта
Используйте мощность, температуру, top_p и другие параметры, доступные только разработчикам, для создания более уникальных и привлекательных ответов от ChatGPT
Создавайте интеллектуальных ботов для серверов Slack или Discord
Включайте контекст в запросы для улучшения ответов и применяйте расширенные функции API.
Изучите будущие направления для ChatGPT и OpenAI
Для кого предназначена эта книга:
Начинающие разработчики Java и разработчики среднего уровня, которые имеют базовое представление о концепциях программирования на Java и заинтересованы в изучении того, как добавить интеллектуальности в свои приложения с помощью программного обеспечения ChatGPT. Предварительный опыт работы с API-интерфейсами ChatGPT или OpenAI не требуется.
Примеры страниц (скриншоты)
Оглавление
About the Author ................................................................................. ix
About the Technical Reviewer ............................................................. xi
Foreword ........................................................................................... x.iii
Chapter 1: Introducing ChatGPT for Java Developers ........................... 1
Who Is This Book For? ........................................................................................... 1
Chapter Overview .................................................................................................. 2
Download the Code Now! ...................................................................................... 2
So, What Exactly Is ChatGPT and Why Do I Need to Use the OpenAI AP ls? ........... 2
Regex vs. ChatGPT: Fight! ..................................................................................... 5
Analysis Question #1: Who Didn't Get Any Ice Cream and Why? ..................... 7
Analysis Question #2: Which Kid Was Probably Left Sad? ............................... 9
Let's Unlearn Some Words in Order to Learn More About the ChatGPT API ........ 10
Models. Models? Models!!! ........................................................................... 10
When We Talk About Tokens, Think About the StringTokenizer and
Not Access Tokens ......................................................................................... 15
Temperature Is All About Creativity ................................................................ 16
Getting Started with the OpenAI Playground ...................................................... 17
1. System ....................................................................................................... 19
2. User ........................................................................................................... 20
3. Assistant (Optional) .................................................................................... 20
4. Add Message (Optional) ............................................................................. 21
5. View Code (Optional) .................................................................................. 21
6. Model (Optional) ........................................................................................ 21
7. Temperature (Optional) .............................................................................. 22
8. Maximum Length (Optional) ...................................................................... 22
Try It Now! Experimenting with the "System" Role ............................................. 22
Conclusion .......................................................................................................... 23
Chapter 2: Using ChatGPT As Your Java Pair-Programmer ................ 25
Creating Your First Java ChatGPT App: ListModels.java ...................................... 26
List Models Endpoint. .......................................................................................... 26
Creating the Request ..................................................................................... 26
Handling the JSON Response ........................................................................ 27
Model (JSON) ................................................................................................. 27
Chat Endpoint. ..................................................................................................... 32
Creating the Request ..................................................................................... 32
Chat (JSON) ................................................................................................... 33
Handling the Response .................................................................................. 42
Chat Completion (JSON) ................................................................................ 43
Wait, How Many Tokens Are in My Prompt? ........................................................ 46
ChatGPT Token Counter ................................................................................. 46
Creating the Next Java App: ChatGPTClient.java ................................................. 48
Conclusion .......................................................................................................... 56
Chapter 3: Using Al in the Enterprise! Creating a Text Summarizer
for Slack Messages ........................................................... 57
So, What Is Prompt Engineering? ........................................................................ 58
Updating ChatGPTClient.java (and Related Classes) with the Builder Pattern .... 58
ChatGPT Is Here to Take Away Everyone's Jobs (Not Really) .............................. 64
Examining a Real World Problem: Customer Support for a Software Company ..... 64
Prompt Engineering 101: Text Summarization .................................................... 68
Prompt #1: "tl;dr" .......................................................................................... 69
Prompt #2: "Explain This in 3 Sentences or Less" ........................................ 71
Prompt #3: "I'm a Manager. Explain to Me What Happened" ........................ 72
Prompt #4: "Give Me Suggestions on Next Steps" ........................................ 74
Let's Talk About Real Prompt Engineering ..................................................... 77
Registering a Slack Bot App ................................................................................ 77
Specifying What Your Bot Can (and Can't) Do By Setting the Scope ............. 80
Confirming Your Settings ............................................................................... 82
Viewing the OAuth and Permissions Page ..................................................... 82
Installing Your Slack Bot App to Your Workspace .......................................... 83
Getting Your Slack Bot (Access) Token .......................................................... 85
Inviting Your Bot to Your Channel... ................................................................ 86
Finding the Channel ID of Your Channel .............................................................. 87
Using Your Slack Bot App to Automatically Grab Messages from a Channel ...... 87
Setting Up Your Dependencies ...................................................................... 87
Programmatically Reading Messages from Slack with
ChannelReaderSlackBot.java ......................................................................... 91
Exercises Left for the Reader .............................................................................. 96
Conclusion .......................................................................................................... 97
Chapter 4: Multimodal Al: Creating a Podcast Visualizer
with Whisper and DALL·E 3 ............................................... 99
Introducing the Whisper Model by OpenAI ........................................................ 102
Features and Limitations of the Whisper Model.. .............................................. 105
Transcriptions Endpoint .................................................................................... 108
Creating the Request ................................................................................... 108
Request Body (Multi part Form Data) ........................................................... 109
Creating a Utility App to Split Audio Files: AudioSplitter.java ............................ 111
Creating the Audio Transcriber: WhisperClient.java .......................................... 116
Having a Little Fun and Trying Things Out with a Podcast ................................ 122
Going Meta: Prompt Engineering GPT-4 to Write a Prompt for DALL·E .............. 126
Create Image Endpoint. ..................................................................................... 128
Creating the Request ................................................................................... 128
Create Image (JSON) ................................................................................... 129
Handling the Response ................................................................................ 131
Image (JSON) ............................................................................................... 132
Creating the Image Generator: DALLEClient.java .............................................. 132
DALL·E Prompt Engineering and Best Practices ............................................... 136
DALL·E Golden Rule #1: Get Familiar with the Types of Images that
DALL·E Can Generate ................................................................................... 137
DALL·E Golden Rule #2: Be Descriptive with What You Want in the
Foreground and Background ....................................................................... 138
Conclusion ........................................................................................................ 139
Exercises Left for the Reader ............................................................................ 140
Chapter 5: Creating an Automated Community Manager Bot with
Discord and Java ............................................................. 141
Choosing Discord as Your Community Platform ................................................ 142
Creating a More Advanced Bot Than Our Slack Bot .......................................... 143
Creating a More Advanced Bot Than Any Typical Discord Bot.. ......................... 143
Understanding the Roles for the Bots .......................................................... 144
Our Example Bank: Crook's Bank ...................................................................... 144
FirstThings First: Create Your Own Discord Server .......................................... 145
Create the Q&A Channel .................................................................................... 147
Registering a New Discord Bot App with Discord ............................................. 148
Specifying General Info for the Bot ................................................................... 150
Specifying OAuth2 Parameters for the Bot ....................................................... 151
Invite Your Bot to Your Server. ........................................................................... 153
Getting the Discord ID Token for Your Bot and Setting the Gateway Intents ..... 155
Creating a Q&A Bot App in Java to Answer Questions from a Channel ............. 158
Setting Up Your Dependencies .................................................................... 159
Creating The First Discord Bot: TechSupportBotDumb.java ............................... 160
Loving the Lambda Expression to Simplify Code ......................................... 164
Handling Messages Sent to the Discord Server .......................................... 165
Success! Running Your First Discord Bot: TechSupportBotDumb.java ......... 166
Streamlining the Process of Registering Our Next Discord Bot App with
Discord .............................................................................................................. 167
Registering a New Discord Bot App with Discord ........................................ 167
Specifying General Info for the Bot... ........................................................... 168
Specifying OAuth2 Parameters for the Bot.. ................................................ 168
Invite Your Bot to Your Server ...................................................................... 169
Getting the Discord ID Token for Your Bot and Setting the
Gateway lntents ........................................................................................... 169
Creating the Next Discord Bot: ContentModeratorBotDumb.java ...................... 169
Handling Messages Sent to the Discord Server .......................................... 173
Success Again! Running Your Second Discord Bot:
ContentModeratorBotDumb.java .................................................................. 17 4
Conclusion ........................................................................................................ 17 4
Exercises Left for the Reader ............................................................................ 175
Chapter 6: Adding Intelligence to Our Discord Bots, Part 1:
Using the Chat Endpoint for Q&A ..................................... 177
Making TechSupportBot.java More Intelligent .................................................. 178
Important Changes to Note from the Previous Version of the Tech
Support Bot ....................................................................................................... 185
Updates to the onMessageReceivedQ Method ............................................ 186
Analyzing ChatGPTClientForQAandModeration.java .......................................... 186
Using JSONPath in Order to Extract Content Quickly in JSON Files ............ 192
Running Our Intelligent Q&A Bot: TechSupportBot.java ............................... 192
We Have a Monumental Achievement. .. With One Slight Flaw ........................ 195
Update the System Message to ChatGPT and Let's Try Again ........................... 196
Conclusion ........................................................................................................ 198
Chapter 7: Adding Intelligence to Our Discord Bots, Part 2:
Using the Chat and Moderation Endpoints for
Moder-at.ion ...................................................................... 199
Moderations Endpoint ....................................................................................... 201
Creating the Request ................................................................................... 202
Create Moderation (JSON) ........................................................................... 203
Handling the JSON Response ...................................................................... 203
Moderation (JSON) ...................................................................................... 204
Creating Our Client for the Moderations Endpoint: ModerationClient.java ........ 208
Making ContentModeratorBot.java More Intelligent ......................................... 213
Important Changes to Note from the Previous Version of the Content
Moderator Bot ................................................................................................... 219
Updates to the onMessageReceived() Method ........................................... 220
Running Our Intelligent Content Moderator Bot: ContentModeratorBot.java ..... 221
Conclusion ........................................................................................................ 223
Exercises Left for the Reader ............................................................................ 223
Appendix 1: List of OpenAI Models ................................................... 225
lndex ................................................................................................. 229
Download
Rutracker.org не распространяет и не хранит электронные версии произведений, а лишь предоставляет доступ к создаваемому пользователями каталогу ссылок на торрент-файлы, которые содержат только списки хеш-сумм
Как скачивать? (для скачивания .torrent файлов необходима регистрация)
[Профиль]  [ЛС] 
 
Ответить
Loading...
Error