Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -137,16 +137,12 @@ def main():
|
|
137 |
placeholder="Specific methodology, theoretical framework, case studies, etc...",
|
138 |
height=100
|
139 |
)
|
140 |
-
api_key =
|
141 |
-
"Enter your Groq API Key",
|
142 |
-
type="password",
|
143 |
-
help="Your API key is used only to generate your document and is never stored."
|
144 |
-
)
|
145 |
if st.button("π Generate Thesis Document", type="primary", use_container_width=True):
|
146 |
if not topic.strip():
|
147 |
st.error("Please enter a thesis topic!")
|
148 |
-
elif not api_key
|
149 |
-
st.error("Please
|
150 |
else:
|
151 |
research_areas_text = research_areas if research_areas.strip() else "general academic research"
|
152 |
result = run_thesis_writer(topic, document_type, academic_level, research_areas_text, word_count, additional_requirements, api_key)
|
|
|
137 |
placeholder="Specific methodology, theoretical framework, case studies, etc...",
|
138 |
height=100
|
139 |
)
|
140 |
+
api_key = os.environ.get("GROQ_API_KEY")
|
|
|
|
|
|
|
|
|
141 |
if st.button("π Generate Thesis Document", type="primary", use_container_width=True):
|
142 |
if not topic.strip():
|
143 |
st.error("Please enter a thesis topic!")
|
144 |
+
elif not api_key:
|
145 |
+
st.error("Groq API key not configured. Please set GROQ_API_KEY environment variable.")
|
146 |
else:
|
147 |
research_areas_text = research_areas if research_areas.strip() else "general academic research"
|
148 |
result = run_thesis_writer(topic, document_type, academic_level, research_areas_text, word_count, additional_requirements, api_key)
|