@@ -87,7 +87,7 @@ def gemini_qna(
8787 student_files :List [pathlib .Path ],
8888 readme_file :pathlib .Path ,
8989 api_key :str ,
90- human_language :str = 'Korean' ,
90+ explanation_in :str = 'Korean' ,
9191 ) -> str :
9292 '''
9393 Queries the Gemini API to provide explanations for failed pytest test cases.
@@ -109,7 +109,7 @@ def gemini_qna(
109109 report_paths ,
110110 student_files ,
111111 readme_file ,
112- human_language
112+ explanation_in
113113 )
114114
115115 answers = ask_gemini (consolidated_question , api_key )
@@ -121,7 +121,7 @@ def get_the_question(
121121 report_paths :Tuple [pathlib .Path ],
122122 student_files :Tuple [pathlib .Path ],
123123 readme_file :pathlib .Path ,
124- human_language :str ,
124+ explanation_in :str ,
125125 ) -> str :
126126 questions = []
127127
@@ -145,10 +145,10 @@ def get_initial_instruction(questions:List[str],language:str) -> str:
145145
146146 questions = (
147147 # Add the initial instruction
148- [get_initial_instruction (questions , human_language ), get_report_header (human_language )]
148+ [get_initial_instruction (questions , explanation_in ), get_report_header (explanation_in )]
149149 + questions
150150 # Add the code and instructions
151- + [get_report_footer (human_language ), get_code_instruction (student_files , readme_file , human_language )]
151+ + [get_report_footer (explanation_in ), get_code_instruction (student_files , readme_file , explanation_in )]
152152 )
153153
154154 # Join all questions into a single string
@@ -158,7 +158,7 @@ def get_initial_instruction(questions:List[str],language:str) -> str:
158158
159159
160160@functools .lru_cache
161- def get_directive (human_language :str ) -> str :
161+ def get_directive (explanation_in :str ) -> str :
162162 d = {
163163 'Korean' : '숙제 답안으로 제출한 코드가 오류를 일으킨 원인을 입문자 용어만으로 중복 없는 간결한 문장으로 설명하시오.' ,
164164 'English' : 'Explain in beginner terms, without duplicates, the cause of the error in the code submitted as homework.' ,
@@ -169,7 +169,7 @@ def get_directive(human_language:str) -> str:
169169 'German' : 'Erklären Sie in Anfängerterminologie ohne Duplikate die Ursache des Fehlers im als Hausaufgabe eingereichten Code.' ,
170170 'Thai' : 'อธิบายด้วยภาษาของผู้เริ่มต้นโดยไม่ซ้ำซ้อนว่าสาเหตุของข้อผิดพลาดในรหัสที่ส่งเป็นการบ้านคืออะไร' ,
171171 }
172- return f"{ d [human_language ]} \n "
172+ return f"{ d [explanation_in ]} \n "
173173
174174
175175def collect_longrepr (data :Dict [str , str ]) -> List [str ]:
@@ -184,14 +184,14 @@ def collect_longrepr(data:Dict[str, str]) -> List[str]:
184184
185185
186186@functools .lru_cache
187- def get_question (longrepr :str , human_language :str ,) -> str :
187+ def get_question (longrepr :str , explanation_in :str ,) -> str :
188188 return (
189- get_report_header (human_language ) + f"{ longrepr } \n " + get_report_footer (human_language )
189+ get_report_header (explanation_in ) + f"{ longrepr } \n " + get_report_footer (explanation_in )
190190 )
191191
192192
193193@functools .lru_cache
194- def get_report_header (human_language :str ) -> str :
194+ def get_report_header (explanation_in :str ) -> str :
195195 d = {
196196 'Korean' : "오류 메시지 시작" ,
197197 'English' : "Error Message Start" ,
@@ -203,12 +203,12 @@ def get_report_header(human_language:str) -> str:
203203 'Thai' : "ข้อความผิดพลาดเริ่มต้น" ,
204204 }
205205 return (
206- f"## { d [human_language ]} \n "
206+ f"## { d [explanation_in ]} \n "
207207 )
208208
209209
210210@functools .lru_cache
211- def get_report_footer (human_language :str ) -> str :
211+ def get_report_footer (explanation_in :str ) -> str :
212212 d = {
213213 'Korean' : "오류 메시지 끝" ,
214214 'English' : "Error Message End" ,
@@ -220,15 +220,15 @@ def get_report_footer(human_language:str) -> str:
220220 'Thai' : "ข้อความผิดพลาดสิ้นสุด" ,
221221 }
222222 return (
223- f"## { d [human_language ]} \n "
223+ f"## { d [explanation_in ]} \n "
224224 )
225225
226226
227227@functools .lru_cache
228228def get_code_instruction (
229229 student_files :Tuple [pathlib .Path ],
230230 readme_file :pathlib .Path ,
231- human_language :str ,
231+ explanation_in :str ,
232232 ) -> str :
233233
234234 d_homework_start = {
@@ -276,12 +276,12 @@ def get_code_instruction(
276276 }
277277
278278 return (
279- f"\n \n ## { d_homework_start [human_language ]} \n "
279+ f"\n \n ## { d_homework_start [explanation_in ]} \n "
280280 f"{ assignment_code (student_files )} \n "
281- f"## { d_homework_end [human_language ]} \n "
282- f"## { d_instruction_start [human_language ]} \n "
281+ f"## { d_homework_end [explanation_in ]} \n "
282+ f"## { d_instruction_start [explanation_in ]} \n "
283283 f"{ assignment_instruction (readme_file )} \n "
284- f"## { d_instruction_end [human_language ]} \n "
284+ f"## { d_instruction_end [explanation_in ]} \n "
285285 )
286286
287287
0 commit comments