Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
wasnertobias committed Jan 30, 2025
1 parent d9c8fb5 commit 3fc2f05
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions app/pipeline/inconsistency_check_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,27 @@ def __call__(self, dto: InconsistencyCheckPipelineExecutionDTO, **kwargs):

overall_response: str = ""

for template_file_path, template_file_content in dto.exercise.template_repository.items():
for (
template_file_path,
template_file_content,
) in dto.exercise.template_repository.items():
template_repository = "\n".join(
f"<File path='{template_file_path}'>\n{template_file_content}</File>"

)

if template_file_path in dto.exercise.solution_repository.keys():
solution_file_content = dto.exercise.solution_repository[template_file_path]
solution_file_content = dto.exercise.solution_repository[
template_file_path
]
solution_repository = f"<File path='{template_file_path}'>\n{solution_file_content}</File>"
else:
solution_repository = "\n".join(
f"<File path='{file_path}'>\n{file_content}</File>"
for file_path, file_content in dto.exercise.solution_repository.items()
)
logging.warning(f"Solution file for {template_file_path} not found, using all solution files: {dto.exercise.solution_repository.keys().join(', ')}")
logging.warning(
f"Solution file for {template_file_path} not found, using all solution files: {dto.exercise.solution_repository.keys().join(', ')}"
)

response: str = self.pipeline.invoke(
{
Expand All @@ -80,7 +86,7 @@ def __call__(self, dto: InconsistencyCheckPipelineExecutionDTO, **kwargs):
}
)

overall_response += ('\n' if overall_response else '') + response
overall_response += ("\n" if overall_response else "") + response
self._append_tokens(self.llm.tokens, PipelineEnum.IRIS_INCONSISTENCY_CHECK)

self.callback.done(final_result=overall_response, tokens=self.tokens)

0 comments on commit 3fc2f05

Please sign in to comment.