Exercise#5 ToT-v1

NOTE Langchain

Use of Langchain will simplify the code below. Langchain has not been used deliberately to show you the concept of LLM chains :) in the next iteration you will use Langchain to rewrite this code. If you already know Langchain, then feel free to use it instead of the solution proposed in this notebook.

Objective

Code the creative writing task LLM chain using any LLM model of your choice. You will be using the prompts that you have designed or you can use the prompts provided as solution in Exercise #3. The output from the notebook is the final writeup that you can use for your new product :-)

NOTE:

Use of GPT or other 3rd party LLM API will cost you $. To run the code with GPT a couple of times will cost you under $0.05

Solution

The solution is built with OpenAI/gpt-3-5-turbo. The solution is available under the Models folder. In order to use a different model, you need to change the infrence code in the solution notebook.

Local Jupyter Lab setup

solution-tot-exercise-5

Google Colab

  • Follow instructions in notebook to setup required packages
Open In Colab