Code Monkey home page Code Monkey logo

hackai_hack-230538's Introduction

The temperature agent is a Fetch.ai-based agent that periodically computes the temperature status for users based on their location and temperature thresholds.

Description · Features · Key functionality · Running locally ·


Description

This project is a temperature agent that periodically computes the temperature status for users based on their location and temperature thresholds. It uses the Fetch.ai framework to define an agent that connects to a Redis database to store user data, and uses the OpenWeatherMap API to fetch temperature data for each user's location. The temperature status is computed based on the user's temperature thresholds, and the updated user data is stored back in the Redis database. The agent also sends a message to a Discord channel to notify the user of their temperature status. The agent is deployed on Docker and can be run locally or on a server.

Link to add the discord bot to your server: bot

Available commands

Screenshot 2023-10-11 at 12 02 16 AM

Alert Command

Screenshot 2023-10-11 at 12 01 43 AM

Disable Alerts

Screenshot 2023-10-11 at 12 02 11 AM

Get weather updates

Screenshot 2023-10-11 at 12 02 42 AM

Features

Key Functionality

  • Ability to set max & min temperature thresholds for each user.
  • Ability to get weather updates for any given location.
  • Ability to disable active alerts for a given user.
  • Notifies users periodically if the temperature for a given location exceeds or enters the threshold.

Running locally

You will need to have the necessary environment variables setup in your .env file. This includes your Discord bot token, redis-db url.

DISCORD_BOT_TOKEN =
REDIS_URL =

Note: You should not commit your .env file or it will expose secrets that will allow others to control access to your authentication provider accounts.

  1. Activate Virtual Environment: conda activate hack-ai
  2. Make a new .env file.
  3. Populate the .env file with the necessary environment variables.
pip install -r requirements.txt
python src/main.py

Your bot should be active and running.

Running locally with docker

docker login
docker pull korebhaumik/temperature-agent-hack-ai
docker pull korebhaumik/amd-redis-db
docker network create my-network
docker run -it -d -p 6379:6379 --network my-network --name amd-redis-db korebhaumik/amd-redis-db
docker run -it -d -v ./:/app -e DISCORD_BOT_TOKEN="" -e REDIS_URL=""  --network my-network --name hack-ai korebhaumik/temperature-agent-hack-ai

Note: If the docker image is not available (repo is privated), you can build it locally by running docker build -t temperature-agent-hack-ai . in the root directory of the project.

hackai_hack-230538's People

Contributors

korebhaumik avatar

Watchers

 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.