Update app.py
Browse files32 unmodified lines3334353637383940414243444 unmodified lines4950515253545556575859604 unmodified lines656667686970717273747576239 unmodified lines31631731831932 unmodified linesf"Only include {question_type.lower()} questions.")if model_choice == "OpenAI":response = openai.Completion.create(model="text-davinci-003", # Use the appropriate modelprompt=prompt,max_tokens=150)return response.choices[0].text.strip()elif model_choice == "Gemini":llm = get_llm(model_choice)response = llm.invoke(prompt)4 unmodified linesdef provide_feedback(model_choice, answer):prompt = f"Provide constructive feedback on the following interview answer: {answer}"if model_choice == "OpenAI":response = openai.Completion.create(model="text-davinci-003", # Use the appropriate modelprompt=prompt,max_tokens=150)return response.choices[0].text.strip()elif model_choice == "Gemini":llm = get_llm(model_choice)response = llm.invoke(prompt)4 unmodified linesdef get_tips(model_choice, role):prompt = f"Provide useful interview tips for the role of {role}. Include body language, dress code, etiquette, and role-specific advice."if model_choice == "OpenAI":response = openai.Completion.create(model="text-davinci-003", # Use the appropriate modelprompt=prompt,max_tokens=150)return response.choices[0].text.strip()elif model_choice == "Gemini":llm = get_llm(model_choice)response = llm.invoke(prompt)239 unmodified lines<p>© 2024 TechPrep. All rights reserved.</p></div>""", unsafe_allow_html=True)32 unmodified lines33343536373839404142434445464 unmodified lines51525354555657585960616263644 unmodified lines6970717273747576777879808182239 unmodified lines32232332432 unmodified linesf"Only include {question_type.lower()} questions.")if model_choice == "OpenAI":response = openai.ChatCompletion.create(model="gpt-3.5-turbo", # Use appropriate modelmessages=[{"role": "system", "content": "You are an interviewer providing interview questions."},{"role": "user", "content": prompt}])return response.choices[0].message['content'].strip()elif model_choice == "Gemini":llm = get_llm(model_choice)response = llm.invoke(prompt)4 unmodified linesdef provide_feedback(model_choice, answer):prompt = f"Provide constructive feedback on the following interview answer: {answer}"if model_choice == "OpenAI":response = openai.ChatCompletion.create(model="gpt-3.5-turbo", # Use appropriate modelmessages=[{"role": "system", "content": "You are a feedback provider for interview answers."},{"role": "user", "content": prompt}])return response.choices[0].message['content'].strip()elif model_choice == "Gemini":llm = get_llm(model_choice)response = llm.invoke(prompt)4 unmodified linesdef get_tips(model_choice, role):prompt = f"Provide useful interview tips for the role of {role}. Include body language, dress code, etiquette, and role-specific advice."if model_choice == "OpenAI":response = openai.ChatCompletion.create(model="gpt-3.5-turbo", # Use appropriate modelmessages=[{"role": "system", "content": "You are providing interview tips."},{"role": "user", "content": prompt}])return response.choices[0].message['content'].strip()elif model_choice == "Gemini":llm = get_llm(model_choice)response = llm.invoke(prompt)239 unmodified lines<p>© 2024 TechPrep. All rights reserved.</p></div>""", unsafe_allow_html=True)
app.py+21-16