Merge pull request #1154 from KennyDizi/main

Enhance variable consistency in prompt rendering for PR tools
This commit is contained in:
Tal
2024-08-19 08:48:10 +03:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@ -348,8 +348,8 @@ extra_file_yaml =
set_custom_labels(variables, self.git_provider)
self.variables = variables
system_prompt = environment.from_string(get_settings().get(prompt, {}).get("system", "")).render(variables)
user_prompt = environment.from_string(get_settings().get(prompt, {}).get("user", "")).render(variables)
system_prompt = environment.from_string(get_settings().get(prompt, {}).get("system", "")).render(self.variables)
user_prompt = environment.from_string(get_settings().get(prompt, {}).get("user", "")).render(self.variables)
response, finish_reason = await self.ai_handler.chat_completion(
model=model,

View File

@ -137,8 +137,9 @@ class PRGenerateLabels:
environment = Environment(undefined=StrictUndefined)
set_custom_labels(variables, self.git_provider)
self.variables = variables
system_prompt = environment.from_string(get_settings().pr_custom_labels_prompt.system).render(variables)
user_prompt = environment.from_string(get_settings().pr_custom_labels_prompt.user).render(variables)
system_prompt = environment.from_string(get_settings().pr_custom_labels_prompt.system).render(self.variables)
user_prompt = environment.from_string(get_settings().pr_custom_labels_prompt.user).render(self.variables)
response, finish_reason = await self.ai_handler.chat_completion(
model=model,