chapter three

3 Writing the right prompt

 

In this chapter

  • recognizing the elements that make a prompt effective
  • crafting the right prompt based on your specific needs
  • building and customizing prompt templates in Langflow

Writing the right prompt is the single most important skill you need to develop a GenAI application successfully. The “art and science” that lets you do that is called prompt engineering.

It’s science because we understand the theory behind what makes a prompt clear or ineffective, and we use proven frameworks to guide us. It’s art because there are multiple ways to get the job done. Natural language is intricate, so you must stay creative, experiment, test, and be open to trying something new. I can tell you that prompt engineering is one of the most engaging and inherently “human” parts of GenAI. I hope you enjoy this chapter, which is all about the art and science behind the right prompts.

What makes a good prompt?

Technically, a prompt is the input received by a large language model (LLM) that generates the corresponding output. Practically, well, the prompt is the foundation of everything we build in GenAI.

Prompting enhancement techniques

Prompt templates in Langflow

What if we coded it?

Summary