Spaces:
Sleeping
Sleeping
Update functions.py
Browse files- functions.py +36 -1
functions.py
CHANGED
@@ -167,7 +167,7 @@ def get_contributor_commits(repo_name, contributor, period,branches, updated_tok
|
|
167 |
summarized_commits = [extract_commit_summary(commit) for commit in all_commits]
|
168 |
return summarized_commits
|
169 |
|
170 |
-
def chat_complete(message, model="gpt-3.5-turbo"):
|
171 |
response = openai.ChatCompletion.create(
|
172 |
model=model,
|
173 |
messages=[
|
@@ -197,3 +197,38 @@ def process_commits_with_openai_summaries(commits):
|
|
197 |
summaries.append(summary)
|
198 |
|
199 |
return summaries
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
summarized_commits = [extract_commit_summary(commit) for commit in all_commits]
|
168 |
return summarized_commits
|
169 |
|
170 |
+
def chat_complete(message, model="gpt-3.5-turbo-0125"):
|
171 |
response = openai.ChatCompletion.create(
|
172 |
model=model,
|
173 |
messages=[
|
|
|
197 |
summaries.append(summary)
|
198 |
|
199 |
return summaries
|
200 |
+
|
201 |
+
def generate_contributor_report_prompt(summaries):
|
202 |
+
"""
|
203 |
+
Construct a prompt for generating a report on a contributor's achievements, skills, and areas of improvement.
|
204 |
+
|
205 |
+
Parameters:
|
206 |
+
- summaries: list of str - Summaries of the contributor's commits.
|
207 |
+
|
208 |
+
Returns:
|
209 |
+
- str: A prompt for the OpenAI model.
|
210 |
+
"""
|
211 |
+
summaries_joined = "\n".join([f"- {summary}" for summary in summaries])
|
212 |
+
if len(summaries_joined) > 40000:
|
213 |
+
summaries_joined = summaries_joined[:40000]
|
214 |
+
prompt = f"""
|
215 |
+
Given the following list of commit summaries by a software developer, create a comprehensive report in markdown format outlining the developer's achievements, skills demonstrated through these commits, and areas for improvement. Use headings for each section.
|
216 |
+
|
217 |
+
## Commit Summaries
|
218 |
+
{summaries_joined}
|
219 |
+
|
220 |
+
## Report
|
221 |
+
|
222 |
+
### Achievements
|
223 |
+
- Analyze the summaries to highlight significant contributions and achievements.
|
224 |
+
|
225 |
+
### Skills Demonstrated
|
226 |
+
- Based on the commit summaries, list the technical and soft skills demonstrated by the developer.
|
227 |
+
|
228 |
+
### Areas for Improvement
|
229 |
+
- Suggest areas where the developer could improve based on patterns or gaps identified in the commit summaries.
|
230 |
+
|
231 |
+
Please ensure the report is concise, well-organized, and provides clear insights into the developer's contributions and growth areas.
|
232 |
+
"""
|
233 |
+
markdown = chat_complete(prompt)
|
234 |
+
return markdown
|