Cassandra is the name given to this proof of concept, which consists of a Docker container that executes a Python program.
This program monitors the pages accessed by the integration, which have a callout type block and the emoji is a woman. The text indicated in this block will be sent to the Davinci model of GPT-3 created by OpenAI as prompt.
The response will be added to the callout block in Notion as quote block.
- Docker
- Create a Notion integration for API Key.
- Create a OpenAI API key
All you have to do is add the integration to the page to be monitored. This is done through the three dots button at the top of the page, in the Connections section.
Name | Description | Example |
---|---|---|
NOTION_API_KEY | Required to work with Notion integration. | secret_eyHJKM45WEDIGHJBNIOPpwimvtyk748byk877ED |
OPENAI_API_KEY | Required in order to use the OpenAI GPT-3 model. | sk-pptbkiORt4679kbD358856dvcxQEsfgnlk007hbr5f45h |
You must create a file in utils directory called "env.list" (without the quotes), in this file you must define the system variables indicated below. The file should look like this:
NOTION_API_KEY=secret_eyHJKM45WEDIGHJBNIOPpwimvtyk748byk877ED
OPENAI_API_KEY=sk-pptbkiORt4679kbD358856dvcxQEsfgnlk007hbr5f45h
More information on how to start a Docker container with system variables here.
Thanks to the container.sh file many Docker commands have been simplified. To create the Docker image is as simple as running:
./utils/container.sh image
Running the container is done with this command:
./utils/container.sh run
When the container is started, Cassandra is scheduled as defined in the utils/crontab.txt file. This is the automatic way.
Using container.sh it is also possible to run manually:
./utils/container.sh cassandra
You can open a shell to the container with the following helper:
./utils/container.sh sh
To Notion for their fantastic application and for opening their API to the public.
To OpenAI for Davinci, a spectacular GPT-3 model.