Naz786 commited on
Commit
35e82ee
Β·
verified Β·
1 Parent(s): fbe4e4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
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 = st.text_input(
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.strip():
149
- st.error("Please enter your Groq API key!")
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)