Merge pull request #1020 from Codium-ai/tr/fallbacks

Tr/fallbacks
This commit is contained in:
Tal
2024-07-04 12:12:39 +03:00
committed by GitHub
4 changed files with 88 additions and 12 deletions

View File

@ -329,7 +329,8 @@ class PRCodeSuggestions:
def _prepare_pr_code_suggestions(self, predictions: str) -> Dict:
data = load_yaml(predictions.strip(),
keys_fix_yaml=["relevant_file", "suggestion_content", "existing_code", "improved_code"])
keys_fix_yaml=["relevant_file", "suggestion_content", "existing_code", "improved_code"],
first_key="code_suggestions",last_key="label")
if isinstance(data, list):
data = {'code_suggestions': data}