We need some preparation before running on local machine
- Create telegram bot, follow this instruction: https://core.telegram.org/bots/tutorial
- Get the bot token
- We need tunelling from local so we can register our local webhook to telegram bot, for that, we use ngrok
- Follow instruction here
- Save the domain that generated, and run
ngrok http --domain=[domain] 3000
- For Mindsdb we need 2 credentials. First Youtube Api Key, and Open AI Api Key
- Go to google console, and create api key https://console.cloud.google.com/
- Follow this tutorial
-
Go to OpenAI https://platform.openai.com/
-
Register first, and generate the api key
-
Cool now, you halfway done!
- Build docker images from mindsdb dockerfile. You need to install docker first before do this.
# Build images docker build -t my_mindsdb ./lib/mindsdb # Run the images docker run -p 47334:47334 -p 47335:47335 my_mindsdb
- Go to browser and access
localhost:47734
, it will take some time after docker container successfully run - You will see mindsdb Admin UI
- Now, run every sql on
lib/mindsdb/migrations/setup.sql
in sequence there. User your youtube api key and openai api key if required
- Make sure you install nodejs version 18, and run
npm install
And then
node index.js
- And voila! Your local server is ready!
- This bot only accept 3 commands:
/ask [youtube-video-link]
to set session of video that want to ask/session
to check what current session/help
to show available commands
- Now go to telegram and search your bot name
- And your bot is ready to use!