Add labeling files

This commit is contained in:
Hussam.lawen
2023-12-04 18:22:35 +02:00
parent fe796245a3
commit d2a129fe30
3 changed files with 56 additions and 2 deletions

View File

@ -31,18 +31,31 @@ class PRType(str, Enum):
{%- endif %}
{%- if enable_file_walkthrough %}
class FileWalkthrough(BaseModel):
filename: str = Field(description="the relevant file full path")
changes_in_file: str = Field(description="minimal and concise description of the changes in the relevant file")
{%- endif %}
{%- if enable_semantic_files_types %}
class SemanticLabelFiles(BaseModel):
label: PRType = Field(description="A label that represent a type of semantic code changes. Use the label value, not the name")
files: List[str] = Field(description="a list of files that are relevant to the label. A file may appear in multiple labels")
{%- endif %}
Class PRDescription(BaseModel):
title: str = Field(description="an informative title for the PR, describing its main theme")
type: List[PRType] = Field(description="one or more types that describe the PR type. . Return the label value, not the name.")
type: List[PRType] = Field(description="one or more types that describe the PR type. Return the label value, not the name.")
description: str = Field(description="an informative and concise description of the PR. {%- if use_bullet_points %} Use bullet points.{% endif %}")
{%- if enable_custom_labels %}
labels: List[Label] = Field(min_items=0, description="custom labels that describe the PR. Return the label value, not the name.")
{%- endif %}
{%- if enable_file_walkthrough %}
main_files_walkthrough: List[FileWalkthrough] = Field(max_items=10)
{%- endif %}
{%- if enable_semantic_files_types %}
pr_files_labels[SemanticLabelFiles]
{%- endif %}
=====
@ -61,9 +74,21 @@ labels:
{%- endif %}
description: |-
...
{%- if enable_file_walkthrough %}
main_files_walkthrough:
- ...
- ...
{%- endif %}
{%- if enable_semantic_files_types %}
pr_files_labels:
- label: ...
files:
- |
...
- |
...
...
{%- endif %}
```
Answer should be a valid YAML, and nothing else. Each YAML output MUST be after a newline, with proper indent, and block scalar indicator ('|-')