@@ -116,21 +116,22 @@ async def _get_prediction(self, model: str):
116
116
model = model , temperature = get_settings ().config .temperature , system = system_prompt , user = user_prompt )
117
117
return response
118
118
119
- def gitlab_protctions (self , model_answer : str ) -> str :
119
+ def gitlab_protections (self , model_answer : str ) -> str :
120
120
github_quick_actions_MR = ["/approve" , "/close" , "/merge" , "/reopen" , "/unapprove" , "/title" , "/assign" ,
121
121
"/copy_metadata" , "/target_branch" ]
122
122
if any (action in model_answer for action in github_quick_actions_MR ):
123
123
str_err = "Model answer contains GitHub quick actions, which are not supported in GitLab"
124
124
get_logger ().error (str_err )
125
125
return str_err
126
+ return model_answer
126
127
127
128
def _prepare_pr_answer (self ) -> str :
128
129
model_answer = self .prediction .strip ()
129
130
# sanitize the answer so that no line will start with "/"
130
131
model_answer_sanitized = model_answer .replace ("\n /" , "\n /" )
131
132
model_answer_sanitized = model_answer_sanitized .replace ("\r /" , "\r /" )
132
133
if isinstance (self .git_provider , GitLabProvider ):
133
- model_answer_sanitized = self .gitlab_protctions (model_answer_sanitized )
134
+ model_answer_sanitized = self .gitlab_protections (model_answer_sanitized )
134
135
if model_answer_sanitized .startswith ("/" ):
135
136
model_answer_sanitized = " " + model_answer_sanitized
136
137
if model_answer_sanitized != model_answer :
0 commit comments