Update app.py
Browse files
app.py
CHANGED
|
@@ -24,6 +24,8 @@ progress_data = {
|
|
| 24 |
def get_llm(model_choice):
|
| 25 |
if model_choice == "Gemini":
|
| 26 |
return ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=GOOGLE_API_KEY)
|
|
|
|
|
|
|
| 27 |
elif model_choice == "OpenAI":
|
| 28 |
return None
|
| 29 |
else:
|
|
@@ -41,7 +43,7 @@ def generate_questions(model_choice, role, question_type, num_questions, difficu
|
|
| 41 |
max_tokens=150
|
| 42 |
)
|
| 43 |
return response.choices[0].text.strip().split("\n")
|
| 44 |
-
elif model_choice
|
| 45 |
llm = get_llm(model_choice)
|
| 46 |
response = llm.invoke(prompt)
|
| 47 |
return response.content.split("\n")
|
|
@@ -57,7 +59,7 @@ def provide_feedback(model_choice, answer):
|
|
| 57 |
max_tokens=150
|
| 58 |
)
|
| 59 |
return response.choices[0].text.strip()
|
| 60 |
-
elif model_choice
|
| 61 |
llm = get_llm(model_choice)
|
| 62 |
response = llm.invoke(prompt)
|
| 63 |
return response.content
|
|
@@ -73,7 +75,7 @@ def get_tips(model_choice, role):
|
|
| 73 |
max_tokens=150
|
| 74 |
)
|
| 75 |
return response.choices[0].text.strip()
|
| 76 |
-
elif model_choice
|
| 77 |
llm = get_llm(model_choice)
|
| 78 |
response = llm.invoke(prompt)
|
| 79 |
return response.content
|
|
@@ -207,9 +209,8 @@ st.markdown(
|
|
| 207 |
color: white;
|
| 208 |
background-color: #4CAF50;
|
| 209 |
border: none;
|
| 210 |
-
border-radius:
|
| 211 |
cursor: pointer;
|
| 212 |
-
transition: background-color 0.3s ease;
|
| 213 |
}
|
| 214 |
.stButton>button:hover {
|
| 215 |
background-color: #45a049;
|
|
@@ -280,8 +281,12 @@ nav_option = st.sidebar.radio("Choose an option:",
|
|
| 280 |
if nav_option == "Generate Questions":
|
| 281 |
st.header("📝 Generate Interview Questions")
|
| 282 |
|
| 283 |
-
model_choice = st.selectbox("Choose Model:", ["OpenAI", "Gemini"])
|
| 284 |
-
role = st.selectbox("Role", [
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
question_type = st.selectbox("Question Type:", ["Behavioral", "Technical", "Situational", "Case Study", "Problem Solving"])
|
| 286 |
num_questions = st.number_input("Number of Questions:", min_value=1, max_value=20, value=5)
|
| 287 |
difficulty = st.selectbox("Difficulty Level:", ["Basic", "Medium", "Complex"])
|
|
|
|
| 24 |
def get_llm(model_choice):
|
| 25 |
if model_choice == "Gemini":
|
| 26 |
return ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=GOOGLE_API_KEY)
|
| 27 |
+
elif model_choice == "Groq":
|
| 28 |
+
return ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=GOOGLE_API_KEY) # Groq uses Gemini AI
|
| 29 |
elif model_choice == "OpenAI":
|
| 30 |
return None
|
| 31 |
else:
|
|
|
|
| 43 |
max_tokens=150
|
| 44 |
)
|
| 45 |
return response.choices[0].text.strip().split("\n")
|
| 46 |
+
elif model_choice in ["Gemini", "Groq"]:
|
| 47 |
llm = get_llm(model_choice)
|
| 48 |
response = llm.invoke(prompt)
|
| 49 |
return response.content.split("\n")
|
|
|
|
| 59 |
max_tokens=150
|
| 60 |
)
|
| 61 |
return response.choices[0].text.strip()
|
| 62 |
+
elif model_choice in ["Gemini", "Groq"]:
|
| 63 |
llm = get_llm(model_choice)
|
| 64 |
response = llm.invoke(prompt)
|
| 65 |
return response.content
|
|
|
|
| 75 |
max_tokens=150
|
| 76 |
)
|
| 77 |
return response.choices[0].text.strip()
|
| 78 |
+
elif model_choice in ["Gemini", "Groq"]:
|
| 79 |
llm = get_llm(model_choice)
|
| 80 |
response = llm.invoke(prompt)
|
| 81 |
return response.content
|
|
|
|
| 209 |
color: white;
|
| 210 |
background-color: #4CAF50;
|
| 211 |
border: none;
|
| 212 |
+
border-radius: 5px;
|
| 213 |
cursor: pointer;
|
|
|
|
| 214 |
}
|
| 215 |
.stButton>button:hover {
|
| 216 |
background-color: #45a049;
|
|
|
|
| 281 |
if nav_option == "Generate Questions":
|
| 282 |
st.header("📝 Generate Interview Questions")
|
| 283 |
|
| 284 |
+
model_choice = st.selectbox("Choose Model:", ["OpenAI", "Gemini", "Groq"])
|
| 285 |
+
role = st.selectbox("Role", [
|
| 286 |
+
"Software Engineer", "Data Scientist", "ML Engineer", "GenAI Specialist",
|
| 287 |
+
"Product Manager", "UX Designer", "DevOps Engineer", "Cloud Architect",
|
| 288 |
+
"Business Analyst", "Database Administrator", "System Administrator", "Network Engineer"
|
| 289 |
+
])
|
| 290 |
question_type = st.selectbox("Question Type:", ["Behavioral", "Technical", "Situational", "Case Study", "Problem Solving"])
|
| 291 |
num_questions = st.number_input("Number of Questions:", min_value=1, max_value=20, value=5)
|
| 292 |
difficulty = st.selectbox("Difficulty Level:", ["Basic", "Medium", "Complex"])
|