Skip to content

Commit f9de943

Browse files
committed
refactor(llm_client): improve prompt formatting and clarity
Refactored the prompt generation in the LLMClient class to enhance clarity and structure. Removed unnecessary repository details and streamlined user instructions for better readability. This change aims to improve user experience by providing clearer guidance on how to format commit messages, including the introduction of Semantic Commit Message types.
1 parent fb758ee commit f9de943

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

penify_hook/llm_client.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ def generate_commit_summary(self, diff: str, message: str, repo_details: Dict, j
5151
# Create prompt for the LLM
5252
prompt = f"""
5353
Based on the Git diff below, generate a concise and descriptive commit summary.
54-
55-
Repository: {repo_details.get('organization_name')}/{repo_details.get('repo_name')}
56-
Hosted on: {repo_details.get('vendor', 'Unknown')}
57-
54+
5855
User instructions: {message}
5956
"""
6057

@@ -94,8 +91,17 @@ def generate_commit_summary(self, diff: str, message: str, repo_details: Dict, j
9491
```
9592
9693
Please provide:
97-
1. A short, focused commit title (50-72 characters)
98-
2. A more detailed description of the changes that addresses both business and technical aspects
94+
1. A short, focused commit title (50-72 characters) in a Semantic Commit Messages format. Format: <type>(<scope>): <subject>
95+
2. A detailed description that explains what was changed, why it was changed in both business and technical aspects, and any important context
96+
97+
List of Semantic Commit Message types that you can use:
98+
feat: (new feature for the user, not a new feature for build script)
99+
fix: (bug fix for the user, not a fix to a build script)
100+
docs: (changes to the documentation)
101+
style: (formatting, missing semi colons, etc; no production code change)
102+
refactor: (refactoring production code, eg. renaming a variable)
103+
test: (adding missing tests, refactoring tests; no production code change)
104+
chore: (updating grunt tasks etc; no production code change)
99105
100106
Format your response as valid JSON with 'title' and 'description' keys.
101107
"""

0 commit comments

Comments
 (0)