Add /generate_labels function + fix issues

This commit is contained in:
Hussam.lawen
2023-10-26 23:28:33 +03:00
parent 16777a5334
commit f3bdbfc103
11 changed files with 291 additions and 22 deletions

View File

@ -43,7 +43,9 @@ class PRDescription:
"use_bullet_points": get_settings().pr_description.use_bullet_points,
"extra_instructions": get_settings().pr_description.extra_instructions,
"commit_messages_str": self.git_provider.get_commit_messages(),
"custom_labels": ""
"enable_custom_labels": get_settings().pr_description.enable_custom_labels,
"custom_labels": "",
"custom_labels_examples": "",
}
self.user_description = self.git_provider.get_user_description()
@ -141,7 +143,7 @@ class PRDescription:
variables["diff"] = self.patches_diff # update diff
environment = Environment(undefined=StrictUndefined)
await set_custom_labels(variables)
set_custom_labels(variables)
system_prompt = environment.from_string(get_settings().pr_description_prompt.system).render(variables)
user_prompt = environment.from_string(get_settings().pr_description_prompt.user).render(variables)