Skip to main content

An LLM Chatbot integrated with Open Weather API for Real-Time Weather Information.

Project description

Weather Chatbot

An LLM Chatbot integrated with Open Weather API for Real-Time Weather Information.

Features

  • Get current weather information for any city.
  • Get a 2-day weather forecast for any city.
  • Utilizes LangChain for agent-based interactions.
  • Runs on CPU using llama-cpp-python.
  • Supports a context length of 128k tokens with the phi-3-mini-128k-instruct-gguf model.

Installation

You can install the package using pip:

pip install weather-chatbot-phi3

Useage

from weather_chatbot import WeatherChatbot

chatbot = WeatherChatbot()
response = chatbot.get_weather("New York")
print(response)

Under the Hood

This project leverages the power of LangChain for orchestrating the LLM interactions. Here's a breakdown of the key components:

LangChain Agents and Tools

  • Agents: LangChain's agent framework is used to create an intelligent assistant capable of performing specific tasks based on natural language inputs.
  • Tools: Two main tools are integrated into the agent:
    • WeatherLookup: Fetches current weather data.
    • ForecastLookup: Retrieves weather forecast for the next two days.

LLM with llama-cpp-python

The language model used is the phi-3-mini-128k-instruct-gguf, which supports a context length of 128k tokens. This model is run on the CPU using llama-cpp-python, ensuring that it can operate efficiently without the need for GPU resources.

License

This project is licensed under the CC BY-NC-SA 4.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weather_chatbot_phi3-0.1.6.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

weather_chatbot_phi3-0.1.6-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page