SamVidur commited on
Commit
76a8149
·
unverified ·
1 Parent(s): 55dd1f8

added random groq calls

Browse files
Files changed (1) hide show
  1. utils.py +11 -2
utils.py CHANGED
@@ -5,8 +5,17 @@ from groq import Groq
5
  from dotenv import load_dotenv
6
  from pymongo import MongoClient
7
  import certifi
 
8
  load_dotenv()
9
- GROQ_API_KEY = os.getenv("GROQ_API_KEY")
 
 
 
 
 
 
 
 
10
 
11
 
12
  def get_mongo_collection():
@@ -65,4 +74,4 @@ def write_to_file(output_filename,groq_response):
65
  with open(output_filename, 'a', encoding='utf-8') as f:
66
  json.dump(parsed_json, f)
67
 
68
-
 
5
  from dotenv import load_dotenv
6
  from pymongo import MongoClient
7
  import certifi
8
+ import random
9
  load_dotenv()
10
+
11
+ def get_random():
12
+ lst = ["R1","R2","R3","S1","RD1"]
13
+ i = random.randint(0,4)
14
+ return lst[i]
15
+
16
+ some = get_random()
17
+ GROQ_API_KEY = os.getenv(f"GROQ_API_KEY{some}")
18
+ # GROQ_API_KEY = os.getenv("GROQ_API_KEY")
19
 
20
 
21
  def get_mongo_collection():
 
74
  with open(output_filename, 'a', encoding='utf-8') as f:
75
  json.dump(parsed_json, f)
76
 
77
+