Chapter 13: Advanced Prompt Engineering

After working with LLMs for the last year, one thing I’m quite sure of is Prompt Engineering is a very crucial concept one must know to yield the best results from any LLM, be it LLaMA, PaLM, Claude, or any other LLM. If you take the strongest of models and provide a bad prompt, the results will be trash. I hope most of you are aware of basic prompt engineering techniques. This chapter is more toward advanced prompt engineering techniques and how to integrate them using LangChain.

 

Before starting, install the packages that we will be using:

 

!pip install langchain==0.0.349 openai==1.3.8 google-search-results==2.4.2 langchain-experimental==0.0.46

 

We will start with:

13.1 Chain of Thoughts

Chain of Thought ...

Get LangChain in your Pocket 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.