Code Monkey home page Code Monkey logo

air-ai's Introduction

AirAI

Project Setup and Execution

Backend Web Server

1. Requirements

  • Python 3

2. Setup steps

  • Install Python dependencies:
pip install langchain
pip install openai

3. Execution steps

  • Set up the OpenAI API key:

(Linux)

export OPENAI_API_KEY="<API_KEY>"

(Windows)

set OPENAI_API_KEY="<API_KEY>"
  • Change the current directory to air-ai-backend
cd air-ai-backend
  • Start the Web server
python server.py

Frontend Web Server

1. Requirements

  • Node 16+

2. Setup steps

  • Change the current directory to air-ai-frontend
cd air-ai-frontend
  • Install package dependencies:
npm install

3. Execution steps

  • Change the current directory to air-ai-frontend
cd air-ai-frontend
  • Start the Web server
npm run dev

Approach

The frontend solution is pretty straight forward: get a JSON object from the backend server with cities as keys and their respective air quality index as values and render a speedometer for each city.

The backend solution consists of using the AI to evaluate the user query, extract the list of cities mentioned in the response and finally getting the air quality index for each city.

Challenges

A user query can contain:

  • a city that the user is interested in knowing its air quality

What is the air quality in Paris?

  • a city that the user is not interested in knowing its air quality

What are the cities with the best air quality near Paris?

  • no city names

What are the cities with the worst air quality?

So trying to extract the city names directly from the user query is not going to work.

Areas of Improvement

  • Use the browser Geolocation API for queries like:

What’s the current air quality? (where I am)

  • Use a dedicated API for air quality index data as OpenAI API is not consistent for some cities and has no data for others.

air-ai's People

Contributors

elyesbenabdelkader 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.