diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index 2bcbd89e6..1b3f33c1a 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -348,8 +348,8 @@ async def _get_prediction(self, model: str, patches_diff: str, prompt="pr_descri 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, diff --git a/pr_agent/tools/pr_generate_labels.py b/pr_agent/tools/pr_generate_labels.py index 2657a857b..1911e0cd9 100644 --- a/pr_agent/tools/pr_generate_labels.py +++ b/pr_agent/tools/pr_generate_labels.py @@ -137,8 +137,9 @@ async def _get_prediction(self, model: str) -> str: 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,