Remove __pycache__ directories
Browse files- __pycache__/config.cpython-313.pyc +0 -0
- app.py +0 -2
- config.py +10 -3
- utils/__pycache__/__init__.cpython-313.pyc +0 -0
- utils/__pycache__/events.cpython-313.pyc +0 -0
- utils/__pycache__/packing.cpython-313.pyc +0 -0
- utils/__pycache__/weather.cpython-313.pyc +0 -0
- utils/__pycache__/weather_agent.cpython-313.pyc +0 -0
- utils/weather.py +3 -3
- utils/weather_agent.py +2 -3
__pycache__/config.cpython-313.pyc
DELETED
|
Binary file (362 Bytes)
|
|
|
app.py
CHANGED
|
@@ -3,12 +3,10 @@ import gradio as gr
|
|
| 3 |
import asyncio
|
| 4 |
import logging
|
| 5 |
|
| 6 |
-
|
| 7 |
# Set up logging
|
| 8 |
logging.basicConfig(level=logging.INFO)
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
-
|
| 12 |
# Import chat_interface after environment variables are loaded
|
| 13 |
from bot.chat import chat_interface
|
| 14 |
|
|
|
|
| 3 |
import asyncio
|
| 4 |
import logging
|
| 5 |
|
|
|
|
| 6 |
# Set up logging
|
| 7 |
logging.basicConfig(level=logging.INFO)
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
|
|
|
| 10 |
# Import chat_interface after environment variables are loaded
|
| 11 |
from bot.chat import chat_interface
|
| 12 |
|
config.py
CHANGED
|
@@ -1,5 +1,12 @@
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
+
# Set API keys with fallback to environment variables
|
| 4 |
+
GROQ_API_KEY = "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"
|
| 5 |
+
WEATHER_API_KEY = "23f2196e7e05ac0040dcf0d481d88e99"
|
| 6 |
+
MODEL_NAME = "llama-3.1-8b-instant"
|
| 7 |
+
|
| 8 |
+
# Validate API keys
|
| 9 |
+
if not GROQ_API_KEY:
|
| 10 |
+
raise ValueError("GROQ_API_KEY must be set")
|
| 11 |
+
if not WEATHER_API_KEY:
|
| 12 |
+
raise ValueError("WEATHER_API_KEY must be set")
|
utils/__pycache__/__init__.cpython-313.pyc
DELETED
|
Binary file (166 Bytes)
|
|
|
utils/__pycache__/events.cpython-313.pyc
DELETED
|
Binary file (2.67 kB)
|
|
|
utils/__pycache__/packing.cpython-313.pyc
DELETED
|
Binary file (2.68 kB)
|
|
|
utils/__pycache__/weather.cpython-313.pyc
DELETED
|
Binary file (3.99 kB)
|
|
|
utils/__pycache__/weather_agent.cpython-313.pyc
DELETED
|
Binary file (4.13 kB)
|
|
|
utils/weather.py
CHANGED
|
@@ -2,14 +2,14 @@ import os
|
|
| 2 |
import requests
|
| 3 |
from datetime import datetime
|
| 4 |
import logging
|
| 5 |
-
from config import WEATHER_API_KEY
|
| 6 |
from .weather_agent import WeatherAgent
|
| 7 |
|
| 8 |
# Set up logging
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
-
# Initialize the weather agent
|
| 12 |
-
weather_agent = WeatherAgent()
|
| 13 |
|
| 14 |
def get_weather():
|
| 15 |
"""Fetch weather data from OpenWeather API"""
|
|
|
|
| 2 |
import requests
|
| 3 |
from datetime import datetime
|
| 4 |
import logging
|
| 5 |
+
from config import WEATHER_API_KEY, GROQ_API_KEY
|
| 6 |
from .weather_agent import WeatherAgent
|
| 7 |
|
| 8 |
# Set up logging
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
+
# Initialize the weather agent with API key
|
| 12 |
+
weather_agent = WeatherAgent(groq_api_key=GROQ_API_KEY)
|
| 13 |
|
| 14 |
def get_weather():
|
| 15 |
"""Fetch weather data from OpenWeather API"""
|
utils/weather_agent.py
CHANGED
|
@@ -1,16 +1,15 @@
|
|
| 1 |
import json
|
| 2 |
from datetime import datetime
|
| 3 |
import logging
|
| 4 |
-
from config import WEATHER_API_KEY, GROQ_API_KEY
|
| 5 |
from groq import Groq
|
| 6 |
|
| 7 |
# Set up logging
|
| 8 |
logger = logging.getLogger(__name__)
|
| 9 |
|
| 10 |
class WeatherAgent:
|
| 11 |
-
def __init__(self):
|
| 12 |
logger.info("Initializing WeatherAgent")
|
| 13 |
-
self.groq_client = Groq(api_key=
|
| 14 |
|
| 15 |
def analyze_weather_data(self, forecast_data):
|
| 16 |
"""Use Groq to analyze weather data and provide insights"""
|
|
|
|
| 1 |
import json
|
| 2 |
from datetime import datetime
|
| 3 |
import logging
|
|
|
|
| 4 |
from groq import Groq
|
| 5 |
|
| 6 |
# Set up logging
|
| 7 |
logger = logging.getLogger(__name__)
|
| 8 |
|
| 9 |
class WeatherAgent:
|
| 10 |
+
def __init__(self, groq_api_key):
|
| 11 |
logger.info("Initializing WeatherAgent")
|
| 12 |
+
self.groq_client = Groq(api_key=groq_api_key)
|
| 13 |
|
| 14 |
def analyze_weather_data(self, forecast_data):
|
| 15 |
"""Use Groq to analyze weather data and provide insights"""
|