mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-15 10:10:38 +08:00
Refactor pr_code_suggestions logic and update prompts for clarity and consistency
This commit is contained in:
@ -46,9 +46,7 @@ __old hunk__
|
||||
The output must be a YAML object equivalent to type $PRCodeSuggestionsFeedback, according to the following Pydantic definitions:
|
||||
=====
|
||||
class CodeSuggestionFeedback(BaseModel):
|
||||
{%- if not commitable_code_suggestions_mode %}
|
||||
suggestion_summary: str = Field(description="repeated from the input")
|
||||
{%- endif %}
|
||||
relevant_file: str = Field(description="repeated from the input")
|
||||
suggestion_score: int = Field(description="The actual output - the score of the suggestion, from 0 to 10. Give 0 if the suggestion is plain wrong. Otherwise, give a score from 1 to 10 (inclusive), where 1 is the lowest and 10 is the highest.")
|
||||
why: str = Field(description="Short and concise explanation of why the suggestion received the score (one to two sentences).")
|
||||
@ -61,13 +59,9 @@ class PRCodeSuggestionsFeedback(BaseModel):
|
||||
Example output:
|
||||
```yaml
|
||||
code_suggestions:
|
||||
{%- if not commitable_code_suggestions_mode %}
|
||||
- suggestion_content: |
|
||||
Use a more descriptive variable name here
|
||||
relevant_file: "src/file1.py"
|
||||
{%- else %}
|
||||
- relevant_file: "src/file1.py"
|
||||
{%- endif %}
|
||||
suggestion_score: 6
|
||||
why: |
|
||||
The variable name 't' is not descriptive enough
|
||||
|
Reference in New Issue
Block a user