Chapter 4

Coding with Chatbots


Bullet Engineering prompts

Bullet Chatting with Copilot

Bullet Talking code with ChatGPT

Bullet Getting schooled on the OpenAI playground

Large language models (LLMs) enable computers to understand and generate human languages with astonishing accuracy. Chatbots are easy-to-use interfaces to LLMs that enable conversations with a generative AI model. Using a chatbot, anyone can converse with an LLM in a way that's similar to how you would message a friend or coworker. (To learn about how machine learning and LLMs work, check out Chapter 2.)

Because the generative AI models that underlie AI chatbots have been trained on an enormous amount of text, it can sometimes seem like the chatbots are omniscient. However, after some time working with chatbots and sometimes getting responses that are incoherent or plainly wrong, you'll realize that they're not.

In this chapter, you learn how to use several popular AI chatbots to generate programming code. You also learn how to get better results by improving the inputs, or prompts, that you give an LLM.

Improving Your Prompts ...

Get Coding with AI For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.