Skip to content

Commit

Permalink
Merge pull request #26 from DivyeshVora79909/main
Browse files Browse the repository at this point in the history
feat: improved prompts and added readme in api prompts
  • Loading branch information
sunithvs authored Dec 30, 2024
2 parents 0109e6e + bd2508d commit caaeb61
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
12 changes: 7 additions & 5 deletions modules/ai_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ def generate_profile_summary(self, profile_data):
str: AI-generated profile summary
"""
prompt = (
"Craft a professional, SEO-optimized third-person profile description that:"
"Craft a Concise, SEO-optimized first-person profile description that:"
"\n- Highlights the developer's strongest technical skills and expertise"
"\n- Emphasizes professional achievements and unique value proposition"
"\n- Uses industry-relevant keywords for search optimization"
"\n- Maintains a formal, positive tone"
"\n- Concise and on to the point"
"\n- Uses simple, direct language without excessive superlatives"
"\n- Incorporates unique details from the profile, bio and readme.md (if available)"
"\n- Limits the bio to 2-3 sentences"
"\n\nProfile Details:"
f"\nName: {profile_data['name']}"
f"\nCore Technical Skills: {', '.join([lang[0] for lang in profile_data['top_languages']])}"
f"\n- Followers: {profile_data['followers']} (indicating professional network and influence)"
f"\n- Public Repositories: {profile_data['public_repos']} (demonstrating active development)"
f"\n- Bio: {profile_data['bio']}"
"\n\nGenerate a concise, compelling description that positions the developer as a high-performing, innovative professional in their field. Use clear, professional language that showcases expertise, reliability, and technical prowess with 2 paragraphs only in simple english"
"\n\nGenerate a short, engaging summary."
f"\n- README: {profile_data['readme_content']}"
)

response = self.client.chat.completions.create(
Expand Down
14 changes: 13 additions & 1 deletion modules/github_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ def fetch_user_profile(username):
following {{
totalCount
}}
repository(name: "{username}") {{
object(expression: "HEAD:README.md") {{
... on Blob {{
text
}}
}}
defaultBranchRef {{
name
}}
}}
repositories(first: 100, orderBy: {{field: UPDATED_AT, direction: DESC}}) {{
totalCount
nodes {{
Expand Down Expand Up @@ -133,7 +143,9 @@ def fetch_user_profile(username):
'total_contributions': graphql_data['contributionsCollection']['contributionCalendar']['totalContributions'],
'repositories_contributed_to': graphql_data['repositoriesContributedTo']['totalCount'],
},
'social_accounts': GitHubProfileFetcher.social_accounts(username)
'social_accounts': GitHubProfileFetcher.social_accounts(username),
'readme_content' :( graphql_data.get('repository', {}).get('object', {}).get('text', '')
if ( graphql_data.get('repository') and graphql_data.get('repository', {}).get('object') ) else '' ) # empty string if falsy values
}

except requests.exceptions.HTTPError as e:
Expand Down

0 comments on commit caaeb61

Please sign in to comment.