From the course: Hands-On AI: Building LLM-Powered Apps
Challenge: Set up prompting - Python Tutorial
From the course: Hands-On AI: Building LLM-Powered Apps
Challenge: Set up prompting
- [Instructor] Welcome to the lab session. In this lab, we will set up prompting for our chat with PDF application. This will enable us to apply prompt engineering methods to fix the deficiencies of our chat with PDF application to produce the desired outcomes. In order to do that, we need to first extract the prompt template for our codebase. We will then put them into the prompt.py file in the app folder. Then we will go to apps and import the prompts from our prompt.py file. And finally, we will add the prompts as part of our keyword arguments when we initialize our retrieval chain. One important trick, we can jump into the source of a piece of code by Control + click or Command + click on the functions or import statements. This will help you navigate the codebase very quickly. As a demo, let's find our RetrievalQAWithSourcesChain, click on it and it will jump to where this is defined. This exercise is to navigate and read the source code to figure out where and what are the prompts. Then we can extract and copy them into prompts.py. This is going to be a fun one and very different from writing code. Good luck.