Niansuh commited on
Commit
c0162e6
Β·
verified Β·
1 Parent(s): c0df58f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -7,6 +7,8 @@ from groq import Groq
7
  _ = load_dotenv(find_dotenv())
8
  st.set_page_config(page_icon="πŸ“ƒ", layout="wide", page_title="ChatGPTBots.net")
9
 
 
 
10
 
11
  def icon(emoji: str):
12
  """Shows an emoji as a Notion-style page icon."""
@@ -20,8 +22,11 @@ def icon(emoji: str):
20
 
21
  st.subheader("TypeGPT.net", divider="rainbow", anchor=False)
22
 
 
 
 
23
  client = Groq(
24
- api_key=os.environ['GROQ_API_KEY'],
25
  )
26
 
27
  # Initialize chat history and selected model
 
7
  _ = load_dotenv(find_dotenv())
8
  st.set_page_config(page_icon="πŸ“ƒ", layout="wide", page_title="ChatGPTBots.net")
9
 
10
+ # Define multiple Groq API keys as environment variables
11
+ groq_api_keys = os.environ.get('GROQ_API_KEYS', '').split(',')
12
 
13
  def icon(emoji: str):
14
  """Shows an emoji as a Notion-style page icon."""
 
22
 
23
  st.subheader("TypeGPT.net", divider="rainbow", anchor=False)
24
 
25
+ # Select a Groq API key from the list
26
+ selected_api_key = st.selectbox("Choose a Groq API key:", options=groq_api_keys)
27
+
28
  client = Groq(
29
+ api_key=selected_api_key,
30
  )
31
 
32
  # Initialize chat history and selected model