to changes suggested by /improve with my small touch

This commit is contained in:
idavidov
2023-08-19 15:31:02 +03:00
parent 5477469a91
commit 7b7e913195
2 changed files with 8 additions and 4 deletions

View File

@ -173,11 +173,15 @@ class GitLabProvider(GitProvider):
'position': pos_obj})
def get_relevant_diff(self, relevant_file, relevant_line_in_file):
for d in self.mr.diffs.list(get_all=True):
changes = self.mr.changes() # Retrieve the changes for the merge request
changes = self.mr.changes() # Retrieve the changes for the merge request once
all_diffs = self.mr.diffs.list(get_all=True)
for d in all_diffs:
for change in changes['changes']:
if change['new_path'] == relevant_file and relevant_line_in_file in change['diff']:
return d
logging.debug(
f'No relevant diff found for {relevant_file} {relevant_line_in_file}. Falling back to last diff.')
return self.last_diff # fallback to last_diff if no relevant diff is found
def publish_code_suggestions(self, code_suggestions: list):

View File

@ -1,7 +1,7 @@
[config]
model="gpt-4"
model="gpt-3.5-turbo-16k"
fallback_models=["gpt-3.5-turbo-16k"]
git_provider="github"
git_provider="gitlab"
publish_output=true
publish_output_progress=true
verbosity_level=0 # 0,1,2