How To Use Chronology -- A Walkthrough Demo
WATCH THE DEMO LIVESTREAM HERE
Step 0 - Installation
- Download Chronology using the command (you can also find it on pip here):
python3 -m pip install chronological- Clone this repo to your local machine
- Create a
.envfile and add your OpenAI API key to it in the format:OPENAI_API_KEY="MY_API_KEY" - Run each step with the command:
python3 step_1.pyStep 1 - Completions
Completions are the bread and butter of the OpenAI API, and the first thing most people use when they use the playground.
In this step, we'll examine how to:
- Read in a prompt from a text file
- Use the prompt to make an
awaited completionfrom thedavinciengine - Load in two variables and attach them to the same prompt
- Create completions with each variable-formatted prompt
Step 2 - Searching
The Semantic Search API is a powerful tool to be able to filter a set of documents based on a query.
In this step, we'll examine how to:
- Read in a list of animals from a text file
- Return the top document that matches our query by using an
awaited searchfrom theadaengine - Return the top three documents that match the same query
Step 3 - Linking it All Together: Extra Logic and Using Different Engines
The power of Chronology starts to show with this step. We'll meld the power of programming logic with the power of the OpenAI API.
In this step, we'll examine how to:
- Capture the result from a search call to OpenAI using the
adaengine - Apply extra logic to that search call
- Run a completion with the result of the search call + logic using the
davinciengine
Extra: Using the UI
If you would prefer to build Chronology chains without writing code, I have great news! There is a no-code UI for Chronology, called the Chronology UI.
Here is a in depth Loom video tutorial on how to use Chronology UI with Chronology
They say a picture is worth 1000 words, so what's a video worth!
You can see the GitHub repo for Chronology UI here