Add truncation and summarization features to PR code suggestions

This commit is contained in:
mrT23
2024-03-04 08:16:05 +02:00
parent 248c6b13be
commit eed23a7aaa
2 changed files with 37 additions and 9 deletions

View File

@ -40,12 +40,14 @@ Specific instructions:
{%- if extra_instructions %}
Extra instructions from the user:
======
{{ extra_instructions }}
======
{%- endif %}
The output must be a YAML object equivalent to type $PRCodeSuggestions, according to the following Pydantic definitions:
=====
class CodeSuggestion(BaseModel):
@ -80,18 +82,18 @@ code_suggestions:
...
{%- if summarize_mode %}
existing_code: |
def func1():
...
improved_code: |
...
one_sentence_summary: |
...
relevant_lines_start: 12
relevant_lines_end: 12
relevant_lines_end: 13
{%- else %}
existing_code: |
def func1():
...
relevant_lines_start: 12
relevant_lines_end: 12
relevant_lines_end: 13
improved_code: |
...
{%- endif %}