JBHF commited on
Commit
f7bf685
·
verified ·
1 Parent(s): 56a8250

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -10,11 +10,16 @@ from prompts import get_research_prompt, get_guidance_prompt, invalid_question_p
10
  load_dotenv()
11
 
12
  # Set up Groq client using st.secrets for secure API key handling
13
- api_key = st.secrets["GROQ_API_KEY"]
14
- if not api_key:
 
 
 
 
 
15
  st.error("GROQ_API_KEY not found. Please check your environment variables.")
16
  else:
17
- client = Groq(api_key=api_key)
18
 
19
  # Function to check internet connection
20
  def is_connected():
 
10
  load_dotenv()
11
 
12
  # Set up Groq client using st.secrets for secure API key handling
13
+ # api_key = st.secrets["GROQ_API_KEY"] # Haalt API key uit een toml file (hier niet van toepassing)
14
+ # groq_api_key = os.environ['GROQ_API_KEY'] # Dit is de methode om de GROQ API key op te halen in HF Spaces omgeving
15
+ groq_api_key = os.environ['GROQ_API_KEY']
16
+ # print("groq_api_key: ", groq_api_key)
17
+
18
+
19
+ if not groq_api_key:
20
  st.error("GROQ_API_KEY not found. Please check your environment variables.")
21
  else:
22
+ client = Groq(api_key=groq_api_key)
23
 
24
  # Function to check internet connection
25
  def is_connected():