Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,13 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
from groq import Groq
|
| 4 |
-
from dotenv import load_dotenv
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
|
| 9 |
def main():
|
| 10 |
st.title("Groq LLM Chatbot")
|
| 11 |
|
| 12 |
-
# Fetch API key from .env file
|
| 13 |
-
groq_api_key = os.getenv("GROQ_API_KEY")
|
| 14 |
-
|
| 15 |
if groq_api_key:
|
| 16 |
client = Groq(api_key=groq_api_key)
|
| 17 |
|
|
@@ -35,7 +31,7 @@ def main():
|
|
| 35 |
else:
|
| 36 |
st.warning("Please enter a message to generate a response.")
|
| 37 |
else:
|
| 38 |
-
st.error("API key not found. Please set GROQ_API_KEY
|
| 39 |
|
| 40 |
if __name__ == "__main__":
|
| 41 |
main()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import os
|
| 3 |
from groq import Groq
|
|
|
|
| 4 |
|
| 5 |
+
# Fetch API key from environment variables
|
| 6 |
+
groq_api_key = os.environ.get("GROQ_API_KEY")
|
| 7 |
|
| 8 |
def main():
|
| 9 |
st.title("Groq LLM Chatbot")
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
if groq_api_key:
|
| 12 |
client = Groq(api_key=groq_api_key)
|
| 13 |
|
|
|
|
| 31 |
else:
|
| 32 |
st.warning("Please enter a message to generate a response.")
|
| 33 |
else:
|
| 34 |
+
st.error("API key not found. Please set the GROQ_API_KEY environment variable.")
|
| 35 |
|
| 36 |
if __name__ == "__main__":
|
| 37 |
main()
|