Spaces:
Runtime error
Runtime error
import google.generativeai as genai | |
import os | |
from dotenv import load_dotenv | |
# Load environment variables | |
load_dotenv() | |
# Google Gemini | |
genai.configure(api_key=os.environ["GOOGLE_API_KEY"]) | |
# Initialize the generative model | |
model = genai.GenerativeModel("gemini-pro") | |
def modelFeedback(ats_score, resume_data): | |
# Create the input prompt template | |
input_prompt_template = """ | |
You are an HR Screening for Resumes. | |
The ATS score for the resume is {ats_score}. | |
Provide a relevant summary (up to 150 words) for the following resume based on this score: | |
{resume_data} | |
""" | |
# Format the prompt with ATS score and resume data | |
input_prompt = input_prompt_template.format(ats_score=ats_score, resume_data=resume_data) | |
# Generate response | |
response = model.generate_content(input_prompt) | |
# Return response text | |
return response.text | |