File size: 1,235 Bytes
37d3a3b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import gspread
import os,random
from Candidate import JobCandidate
from dotenv import load_dotenv
from compator import bubble_sort
from results import writeToSheets
from resume_conversation import chat_with_candidate
sa = gspread.service_account(filename='service_creds.json')
sh = sa.open("Figma_swe")
load_dotenv()

wks = sh.worksheet("Sheet1")
data = wks.get_all_values()


# Load environment variables from the .env file
load_dotenv()
# destination_path = os.path.join(os.getcwd(), id)

candidates=[]

# os.environ['COMPARATOR_LLM']="chat-bison"
os.environ['COMPARATOR_LLM']="gpt-3.5-turbo-1106"
for i in range(1, 7):
    candid =JobCandidate(data[i])
    candidates.append(candid)

# random.shuffle(candidates)
sort_cand = bubble_sort(candidates)

writeToSheets(candidates)

for idx, candidate in enumerate(sort_cand):
    print(str(idx) + '. ' + candidate.email)

print('Select a candidate to chat with. Type in their index number. Type -1 if you dont want to chat.')
idx = int(input())
if idx != -1:
    selected_candidate = candidates[idx]
    chat_with_candidate(selected_candidate)

# for candidate in candidates:
#     print(candidate)
#     print()  # Print a blank line between candidates for better readability