Code Monkey home page Code Monkey logo

cassandra_notion's Introduction

Cassandra Notion bot (powered by GPT-3)

What is this?

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.

Cassandra test

Requeriments

Preparing Notion

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.

Page to be monitored by Cassandra

Running the container

1. Necessary environment variables

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.

2. Create the Docker image

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

3. Run the Docker container

Running the container is done with this command:

./utils/container.sh run

4. Executing Cassandra

a. Through scheduled tasks

When the container is started, Cassandra is scheduled as defined in the utils/crontab.txt file. This is the automatic way.

b. Manually

Using container.sh it is also possible to run manually:

./utils/container.sh cassandra

Some support commands

You can open a shell to the container with the following helper:

./utils/container.sh sh

Credits

To Notion for their fantastic application and for opening their API to the public.

To OpenAI for Davinci, a spectacular GPT-3 model.

cassandra_notion's People

Contributors

jsanchez0x avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.