OpenAI Assistant setup
The tool configures the OpenAI assistant for Botkube AI plugin. It uses documents from the assets directory for file search capabilities.
This project uses Volta to manage JS tools. Volta automatically downloads and installs the right Node.js version when you run any of the node or npm commands.
It is recommended to install it before running the script, to ensure the right Node.js version is used.
Usage
Navigate to the directory hack/assistant-setup and execute one of the following commands.
Install dependencies
To install all dependencies, run:
npm install
Start app
export OPENAI_API_KEY=... # your Open AI API key
export OPENAI_ASSISTANT_ID=... # your Open AI Assistant ID
export OPENAI_PROJECT_ID=... # Optional: your Open AI Project ID
export OPENAI_ORG_ID=... # Optional: your Open AI Organization ID
npm run start
Development
Refetch content for file search
The process uses Jina.AI Reader API and usually takes a few minutes.
A free API token is recommended, to increase the API rate limits, and, in a result, speed up the process. You can get if from the Jina.AI website.
To scrap the content from the latest Botkube website and Botkube Docs, run the following command:
export AI_ASSISTANT_FETCH_CONTENT_API_KEY="jina_..." # get it from https://jina.ai/reader/
npm run fetch-content
By default, before refetching content starts:
- downloaded files starting with package.json
https://botkube.io/blog/* and https://botkube.io/learn/* prefixes are kept and won't be updated,
- all other content is removed.
To refetch all content, run the following command:
export PURGE_ALL_CONTENT=true # default: false
npm run fetch-content
To format code, run:
npm run format