mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-18 11:30:39 +08:00
rename vars + Add to README.md
This commit is contained in:
@ -47,7 +47,7 @@ rank_extended_suggestions = true
|
||||
max_number_of_calls = 5
|
||||
final_clip_factor = 0.9
|
||||
|
||||
[pr_add_docs_prompt] # /add_docs #
|
||||
[pr_add_docs] # /add_docs #
|
||||
extra_instructions = ""
|
||||
docs_style = "Google Style" # "Google Style", "Numpy Style", "Sphinx Style", "PEP257", "reStructuredText"
|
||||
max_number_of_calls = 5
|
||||
|
@ -93,9 +93,9 @@ Don't repeat the prompt in the answer, and avoid outputting the 'type' and 'desc
|
||||
|
||||
user="""PR Info:
|
||||
|
||||
Title: '{{title}}'
|
||||
Title: '{{ title }}'
|
||||
|
||||
Branch: '{{branch}}'
|
||||
Branch: '{{ branch }}'
|
||||
|
||||
Description: '{{description}}'
|
||||
|
||||
|
@ -37,10 +37,10 @@ class PRAddDocs:
|
||||
"description": self.git_provider.get_pr_description(),
|
||||
"language": self.main_language,
|
||||
"diff": "", # empty diff for initial calculation
|
||||
"extra_instructions": get_settings().pr_add_docs_prompt.extra_instructions,
|
||||
"extra_instructions": get_settings().pr_add_docs.extra_instructions,
|
||||
"commit_messages_str": self.git_provider.get_commit_messages(),
|
||||
'docs_for_language': get_docs_for_language(self.main_language,
|
||||
get_settings().pr_add_docs_prompt.docs_style),
|
||||
get_settings().pr_add_docs.docs_style),
|
||||
}
|
||||
self.token_handler = TokenHandler(self.git_provider.pr,
|
||||
self.vars,
|
||||
@ -132,8 +132,8 @@ class PRAddDocs:
|
||||
is_successful = self.git_provider.publish_code_suggestions(docs)
|
||||
if not is_successful:
|
||||
logging.info("Failed to publish code docs, trying to publish each docs separately")
|
||||
for documentation in docs:
|
||||
self.git_provider.publish_code_suggestions([documentation])
|
||||
for doc_suggestion in docs:
|
||||
self.git_provider.publish_code_suggestions([doc_suggestion])
|
||||
|
||||
def dedent_code(self, relevant_file, relevant_lines_start, new_code_snippet, doc_placement='after',
|
||||
add_original_line=False):
|
||||
@ -170,7 +170,7 @@ class PRAddDocs:
|
||||
async def _prepare_prediction_extended(self, model: str) -> dict:
|
||||
logging.info('Getting PR diff...')
|
||||
patches_diff_list = get_pr_multi_diffs(self.git_provider, self.token_handler, model,
|
||||
max_calls=get_settings().pr_add_docs_prompt.max_number_of_calls)
|
||||
max_calls=get_settings().pr_add_docs.max_number_of_calls)
|
||||
|
||||
logging.info('Getting multi AI predictions...')
|
||||
prediction_list = []
|
||||
|
Reference in New Issue
Block a user