# groq_api.py import os import openai # Set your Groq API key openai.api_key = "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" openai.api_base = "https://api.groq.com/openai/v1" MODEL_NAME = "mixtral-8x7b-32768" # You can change to another Groq-supported model def get_summary(jd_text, matched_cvs): joined_cvs = "\n\n".join(matched_cvs) prompt = f""" Given the following job description: {jd_text} And these CVs: {joined_cvs} Summarize which candidates best match the job description and why: """ response = openai.ChatCompletion.create( model=MODEL_NAME, messages=[{"role": "user", "content": prompt}] ) return response.choices[0].message.content.strip()