Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
-
# Import necessary libraries
|
2 |
import os
|
3 |
import streamlit as st
|
4 |
from groq import Groq
|
5 |
|
6 |
# Set the Groq API key
|
7 |
-
os.environ["GROQ_API_KEY"] = "
|
8 |
|
9 |
# Initialize Groq client
|
10 |
client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
|
@@ -23,7 +22,7 @@ def call_groq_api(prompt):
|
|
23 |
except Exception as e:
|
24 |
return f"Error: {str(e)}"
|
25 |
|
26 |
-
# Define functions
|
27 |
def personalized_learning_assistant(topic):
|
28 |
examples = [
|
29 |
"Explain quantum mechanics. Example: Quantum mechanics is the study of particles at the atomic level.",
|
@@ -80,7 +79,7 @@ st.set_page_config(page_title="EduNexus", page_icon=":book:", layout="wide")
|
|
80 |
st.markdown("""
|
81 |
<style>
|
82 |
body {
|
83 |
-
background: linear-gradient(45deg, #
|
84 |
color: #fff;
|
85 |
font-family: 'Arial', sans-serif;
|
86 |
overflow-x: hidden;
|
@@ -175,9 +174,9 @@ with st.form(key="summary_form"):
|
|
175 |
|
176 |
# Interactive Study Planner
|
177 |
st.header("Interactive Study Planner")
|
178 |
-
with st.form(key="
|
179 |
-
schedule_input = st.text_area("Enter your exam schedule
|
180 |
-
submit_button = st.form_submit_button("Generate Study Plan", key="
|
181 |
if submit_button:
|
182 |
if schedule_input:
|
183 |
st.write(interactive_study_planner(schedule_input))
|
|
|
|
|
1 |
import os
|
2 |
import streamlit as st
|
3 |
from groq import Groq
|
4 |
|
5 |
# Set the Groq API key
|
6 |
+
os.environ["GROQ_API_KEY"] = "your_api_key_here"
|
7 |
|
8 |
# Initialize Groq client
|
9 |
client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
|
|
|
22 |
except Exception as e:
|
23 |
return f"Error: {str(e)}"
|
24 |
|
25 |
+
# Define functions for each tool
|
26 |
def personalized_learning_assistant(topic):
|
27 |
examples = [
|
28 |
"Explain quantum mechanics. Example: Quantum mechanics is the study of particles at the atomic level.",
|
|
|
79 |
st.markdown("""
|
80 |
<style>
|
81 |
body {
|
82 |
+
background: linear-gradient(45deg, #000000, #2c3e50);
|
83 |
color: #fff;
|
84 |
font-family: 'Arial', sans-serif;
|
85 |
overflow-x: hidden;
|
|
|
174 |
|
175 |
# Interactive Study Planner
|
176 |
st.header("Interactive Study Planner")
|
177 |
+
with st.form(key="planner_form"):
|
178 |
+
schedule_input = st.text_area("Enter your exam schedule", key="schedule_input", placeholder="e.g., 3 exams in 1 week")
|
179 |
+
submit_button = st.form_submit_button("Generate Study Plan", key="planner_button", css_class="animated-button")
|
180 |
if submit_button:
|
181 |
if schedule_input:
|
182 |
st.write(interactive_study_planner(schedule_input))
|