-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroadmap.py
More file actions
48 lines (37 loc) · 1.06 KB
/
roadmap.py
File metadata and controls
48 lines (37 loc) · 1.06 KB
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
# roadmap.py
import os
from dotenv import load_dotenv
from mistralai import Mistral
load_dotenv()
def generate_ai_feedback(score, repo_data, improvements):
api_key = os.getenv("MISTRAL_API_KEY")
if not api_key:
return "⚠️ Mistral API key not configured. Please set MISTRAL_API_KEY environment variable."
client = Mistral(
api_key=api_key
)
prompt = f"""
You are a senior software engineer and mentor.
Evaluate the following GitHub repository using these signals:
Score: {score}/100
Repository data: {repo_data}
Missing / weak areas: {improvements}
Your task:
1. Write a concise professional evaluation summary
2. Generate a personalized improvement roadmap
3. Explain briefly why each improvement matters
Tone:
- Honest
- Mentor-like
- Recruiter-friendly
Use bullet points.
"""
response = client.chat.complete(
model="mistral-small-latest",
messages=[
{"role": "user", "content": prompt}
],
temperature=0.4,
max_tokens=400
)
return response.choices[0].message.content