You are browsing as a guest. Sign up (or log in) to start making projects!

Sarvgyan

  • 4 Devlogs
  • 3 Total hours

A simple Slack bot that lets you run web search queries (using Tavily API) and sometimes tells you unfunny jokes.

Ship #1 Pending review

Sarvgyan is a slack bot built in python. It can do a small number of things like doing a web-search for you and returning a short AI summary result and sometimes tell you an unfunny joke. (For web-search and AI summary it Uses Tavily Search API)

Available commands with their features:

  • /sarvgyan-ping: Responds with the latency.

  • /sarvgyan-befunny: Tells a randomly sampled joke from a list of 5 jokes defined in the app. (btw the jokes are really unfunny)

  • /sarvgyan-search : Lets you run web search for the given and returns a short AI summary result for the search

In a sense I would say figuring out the right resources to learn to use slack bolt for python was a challenge for me coz this time I wasn’t following the guide which used JS for bot logic, instead I relied on python which I find more comfortable to use. In this process Google AI mode was a help

Anther problem was figuring out how to get the app running 24/7 on nest using systemd.

For trying Sarvgyan out, you can visit the channel “#try-sarvgyan” (use project demo link). There you can use different commands and see it in action.

Try project → See source code →
Open comments for this post

1h 8m 17s logged

Shipping the project

I completed updating the project readme with extensive details: Description, How to try?, How it works? and all the credits.

Here’s how it looks:

0
0
26
Open comments for this post

30m 51s logged

Completed the basic mission requirements of the project

I wrapped up writing the handling logic of the last command for the bot: /sarvgyan-search which takes a query and returns an AI summar answer for the search.

For search, and AI answer I used the free tier of Tavily Search API. (It gives 1000 free req/month)

Next I intent to deploy it on nest to get it up and running 24/7

btw: here’s a search result screenshot from the bot:

0
0
70
Open comments for this post

1h 5m 59s logged

Completed logic for two slack commands

Before writing a single line of code I spent ~1hr learning how to use slack_bolt to register a command listener and how to write logic to perform actions on the command trigger using the decorator @app.command("/command") from the guide and web.

Using it I went on to programming actions for two commands:

  • /sarvgyan-ping: returns latency for acknowledging command.

  • /sarvgyan-befunny: Tells you a joke (which I must say doesn’t look like a joke 😅)

0
0
30
Open comments for this post

28m 24s logged

Project Setup

I worked on setting up the project basics: github repo, installing slack_bolt package and all that.

For this project I’ve decided to not follow the guide and go on to build it on my own in python rather than JS coz I feel more comfortable in it.

I think I’ll be using the official slack guide to help me along the way to build the app in python:

0
0
35

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…