Code Monkey home page Code Monkey logo

howstheweather's Introduction

How's the weather?

Demo

https://howstheweather-delta.vercel.app/

Introduction

Application to fetch weather using the AccuWeather API and Gemini. To spice things up, I'm using Langchain and Google Gemini to reason about the user input. I create a little chain where the user inputs a city, or anything else, and the LLM will try to guess the intended city. With the correct name, the next step is to call the Location API to get the AccuWeather city ID and with that make the API calls for current and forecast weather data. The following images illustrate the data acquisition process, also, take a look at this AccuWeather API diagram.

API Diagram

Features

  • Tests
  • Error handling
  • Loading indicators
  • Weather Data
    • Current temperature
    • Weather description
    • Humidity
    • Wind speed
    • Five days forecast
  • Toggle between Celsius and Fahrenheit

Running

It's necessary to get two API keys to run this app locally, Google Gemini and AccuWeather. A Gemini key it's easy and free to use and can be found at https://ai.google.dev. The AccuWeather has a pretty low free tier of 50 request peer day but it's a simple and useful API. An AccuWeather API can be create at https://developer.accuweather.com/packages. With the two API keys create a .env.local following the .env.example. After that just install the dependencies and run the project.

# Create an env file

cat .env.example > .env.local

# Install the dependencies

pnpm i

# Run the project

pnpm dev

# Run the tests

pnpm test

howstheweather's People

Contributors

kauly avatar

Watchers

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