Skip to content

Commit 39d96c2

Browse files
committed
add internal function get_initial_instruction()
1 parent 5b6be16 commit 39d96c2

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

ai_tutor.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,15 @@ def get_the_question(
134134

135135
questions += longrepr_list
136136

137-
# Add the main directive or instruction based on whether there are failed tests
138-
if questions:
139-
questions.insert(0, get_directive(human_language))
140-
else:
141-
questions.insert(0, f'In {human_language}, please comment on the student code given the assignment instruction.')
137+
def get_initial_instruction(questions:List[str],language:str) -> str:
138+
# Add the main directive or instruction based on whether there are failed tests
139+
if questions:
140+
initial_instruction = get_directive(language)
141+
else:
142+
initial_instruction = f'In {language}, please comment on the student code given the assignment instruction.'
143+
return initial_instruction
144+
145+
questions = [get_initial_instruction(questions, human_language)] + questions
142146

143147
# Add the code and instructions
144148
questions.append(get_code_instruction(student_files, readme_file, human_language))

0 commit comments

Comments
 (0)