Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mor10/basic-models-demo
https://github.com/mor10/basic-models-demo
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mor10/basic-models-demo
- Owner: mor10
- Created: 2024-08-08T04:20:09.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-09T03:12:45.000Z (5 months ago)
- Last Synced: 2024-08-09T06:19:15.766Z (5 months ago)
- Language: Python
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Basic GitHub Models Demo
Basic stand-alone Python AI weather app using [GitHub Models](https://docs.github.com/en/github-models/prototyping-with-ai-models) to leverage models from Mistral and OpenAI that pull and interpret data from OpenWeather's API.## Connecting to OpenWeather
The app uses live weather data from OpenWeather, so to use the app you need a free [OpenWeather API key](https://home.openweathermap.org/api_keys).To add the key, rename `.env-template` to `.env` and paste the key in the obvious space.
## Running the app in GitHub Codespaces
The app connects to GitHub Models using a GitHub Personal Access Token. If you use GitHub Codespaces, you're already logged in and your authentication is handled automatically. To run the app:1. Spin up a Codespace from the repo
2. Open terminal
3. Enter `python weather.py` and follow the instructions in the app.## Running the app in a local editor
If you use a local clone in a stand alone editor or IDE, you need to add a GitHub Personal Access Token:0. Make sure you have a local Python environment
1. Visit [https://github.com/settings/tokens](https://github.com/settings/tokens) and generate a new token with default settings
2. Copy the token (you only get to see it once)
3. To authenticate your connection, either:
- add the token to your environment from bash using `export GITHUB_TOKEN=""`
- add the token to the `.env` file with the name "GITHUB_TOKEN"
4. Open terminal
5. Install Python dependencies `pip install -r requirements.txt`
6. Enter `python weather.py` and follow the instructions in the app