mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 21:00:40 +08:00
feat: Add 'language' field to CodeSuggestion, FileDescription, and ReviewerPrompt models in settings files
This commit is contained in:
@ -51,6 +51,7 @@ The output must be a YAML object equivalent to type $PRCodeSuggestions, accordin
|
|||||||
=====
|
=====
|
||||||
class CodeSuggestion(BaseModel):
|
class CodeSuggestion(BaseModel):
|
||||||
relevant_file: str = Field(description="the relevant file full path")
|
relevant_file: str = Field(description="the relevant file full path")
|
||||||
|
language: str = Field(description="the code language of the relevant file")
|
||||||
suggestion_content: str = Field(description="an actionable suggestion for meaningfully improving the new code introduced in the PR")
|
suggestion_content: str = Field(description="an actionable suggestion for meaningfully improving the new code introduced in the PR")
|
||||||
{%- if summarize_mode %}
|
{%- if summarize_mode %}
|
||||||
existing_code: str = Field(description="a short code snippet from a '__new hunk__' section to illustrate the relevant existing code. Don't show the line numbers.")
|
existing_code: str = Field(description="a short code snippet from a '__new hunk__' section to illustrate the relevant existing code. Don't show the line numbers.")
|
||||||
@ -74,6 +75,8 @@ Example output:
|
|||||||
code_suggestions:
|
code_suggestions:
|
||||||
- relevant_file: |-
|
- relevant_file: |-
|
||||||
src/file1.py
|
src/file1.py
|
||||||
|
language: |-
|
||||||
|
python
|
||||||
suggestion_content: |-
|
suggestion_content: |-
|
||||||
Add a docstring to func1()
|
Add a docstring to func1()
|
||||||
{%- if summarize_mode %}
|
{%- if summarize_mode %}
|
||||||
@ -105,11 +108,6 @@ user="""PR Info:
|
|||||||
|
|
||||||
Title: '{{title}}'
|
Title: '{{title}}'
|
||||||
|
|
||||||
{%- if language %}
|
|
||||||
|
|
||||||
Main PR language: '{{ language }}'
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
|
|
||||||
The PR Diff:
|
The PR Diff:
|
||||||
======
|
======
|
||||||
|
@ -39,6 +39,7 @@ class PRType(str, Enum):
|
|||||||
|
|
||||||
Class FileDescription(BaseModel):
|
Class FileDescription(BaseModel):
|
||||||
filename: str = Field(description="the relevant file full path")
|
filename: str = Field(description="the relevant file full path")
|
||||||
|
language: str = Field(description="the relevant file language")
|
||||||
changes_summary: str = Field(description="concise summary of the changes in the relevant file, in bullet points (1-4 bullet points).")
|
changes_summary: str = Field(description="concise summary of the changes in the relevant file, in bullet points (1-4 bullet points).")
|
||||||
changes_title: str = Field(description="an informative title for the changes in the files, describing its main theme (5-10 words).")
|
changes_title: str = Field(description="an informative title for the changes in the files, describing its main theme (5-10 words).")
|
||||||
label: str = Field(description="a single semantic label that represents a type of code changes that occurred in the File. Possible values (partial list): 'bug fix', 'tests', 'enhancement', 'documentation', 'error handling', 'configuration changes', 'dependencies', 'formatting', 'miscellaneous', ...")
|
label: str = Field(description="a single semantic label that represents a type of code changes that occurred in the File. Possible values (partial list): 'bug fix', 'tests', 'enhancement', 'documentation', 'error handling', 'configuration changes', 'dependencies', 'formatting', 'miscellaneous', ...")
|
||||||
@ -67,6 +68,8 @@ type:
|
|||||||
pr_files:
|
pr_files:
|
||||||
- filename: |
|
- filename: |
|
||||||
...
|
...
|
||||||
|
language: |
|
||||||
|
...
|
||||||
changes_summary: |
|
changes_summary: |
|
||||||
...
|
...
|
||||||
changes_title: |
|
changes_title: |
|
||||||
@ -104,10 +107,7 @@ Previous description:
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
Branch: '{{branch}}'
|
Branch: '{{branch}}'
|
||||||
{%- if language %}
|
|
||||||
|
|
||||||
Main PR language: '{{ language }}'
|
|
||||||
{%- endif %}
|
|
||||||
{%- if commit_messages_str %}
|
{%- if commit_messages_str %}
|
||||||
|
|
||||||
Commit messages:
|
Commit messages:
|
||||||
|
@ -115,6 +115,9 @@ PR Feedback:
|
|||||||
relevant file:
|
relevant file:
|
||||||
type: string
|
type: string
|
||||||
description: the relevant file full path
|
description: the relevant file full path
|
||||||
|
language:
|
||||||
|
type: string
|
||||||
|
description: the language of the relevant file
|
||||||
suggestion:
|
suggestion:
|
||||||
type: string
|
type: string
|
||||||
description: |-
|
description: |-
|
||||||
@ -166,6 +169,8 @@ PR Feedback:
|
|||||||
Code feedback:
|
Code feedback:
|
||||||
- relevant file: |-
|
- relevant file: |-
|
||||||
directory/xxx.py
|
directory/xxx.py
|
||||||
|
language: |-
|
||||||
|
python
|
||||||
suggestion: |-
|
suggestion: |-
|
||||||
xxx [important]
|
xxx [important]
|
||||||
relevant line: |-
|
relevant line: |-
|
||||||
@ -195,10 +200,6 @@ Description:
|
|||||||
======
|
======
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- if language %}
|
|
||||||
|
|
||||||
Main PR language: '{{ language }}'
|
|
||||||
{%- endif %}
|
|
||||||
{%- if commit_messages_str %}
|
{%- if commit_messages_str %}
|
||||||
|
|
||||||
Commit messages:
|
Commit messages:
|
||||||
|
Reference in New Issue
Block a user