From the course: Building Apps with AI Tools: ChatGPT, Semantic Kernel, and Langchain

Unlock this course with a free trial

Join today to access over 23,100 courses taught by industry experts.

Providing a discount through a UI

Providing a discount through a UI

- [Instructor] Have you ever had a frustrating experience with a company or product, and then when you left a review were offered a discount? Let's build a small GPT-4 app to accomplish that. Our goal is to use GPT-4 to change the output of a webpage based on what the user has detected. Let's open up our branch 02_02b and check the structure. We'll see a couple of pages here. In our source folder, we'll see here that we have a main.py, which represents our FastAPI page. So we'll be using FastAPI since we're running a backend server. Next in our services folder you can see our ai.py. This houses our actual GPT-4 logic where we provide a response. Next, under Static, we'll see our index.html. This is a simple webpage that we'll use to call our backend API. And finally, we have our requirements.txt. We'll need to install FastAPI and Uvicorn in order to run this. So let's install our requirements. First, let's check…

Contents