saherPervaiz commited on
Commit
1ab5dc9
·
verified ·
1 Parent(s): 9297b67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -4,13 +4,15 @@ import pandas as pd
4
  import requests
5
  from groq import Groq
6
 
7
- # Fetch the GROQ API key from the environment variable
 
 
8
  groq_api_key = os.getenv("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")
9
 
10
  # Check if the API key is available
11
  if not groq_api_key:
12
- st.error("GROQ_API_KEY is not set. Please provide a valid API key.")
13
- st.stop()
14
 
15
  # Initialize the GROQ client with the fetched API key
16
  groq_client = Groq(api_key=groq_api_key)
 
4
  import requests
5
  from groq import Groq
6
 
7
+ import os
8
+
9
+ # Fetch the API key
10
  groq_api_key = os.getenv("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")
11
 
12
  # Check if the API key is available
13
  if not groq_api_key:
14
+ raise ValueError("GROQ_API_KEY is not set. Please provide a valid API key.")
15
+
16
 
17
  # Initialize the GROQ client with the fetched API key
18
  groq_client = Groq(api_key=groq_api_key)