@@ -10,8 +10,9 @@ class QuizGenerator(BaseGenerator):
1010 Quiz Generator rephrases given descriptions to create quiz questions.
1111 """
1212
13+ @staticmethod
1314 def build_prompt (
14- self , batch : tuple [list [tuple [str , dict ]], list [tuple [Any , Any , dict ]]]
15+ batch : tuple [list [tuple [str , dict ]], list [tuple [Any , Any , dict ]]]
1516 ) -> str :
1617 """
1718 Build prompt for rephrasing the description.
@@ -34,7 +35,7 @@ def build_prompt(
3435 "Batch must contain at least one node or edge with description"
3536 )
3637
37- return self .build_prompt_for_description (description , template_type )
38+ return QuizGenerator .build_prompt_for_description (description , template_type )
3839
3940 @staticmethod
4041 def build_prompt_for_description (
@@ -53,20 +54,21 @@ def build_prompt_for_description(
5354 return prompt
5455
5556 @staticmethod
56- def parse_rephrased_text (response : str ) -> str :
57- """
58- Parse the rephrased text from the response.
59- :param response:
60- :return:
61- """
62- rephrased_text = response .strip ().strip ('"' )
63- logger .debug ("Rephrased Text: %s" , rephrased_text )
64- return rephrased_text
65-
66- def parse_response (self , response : str ) -> Any :
57+ def parse_response (response : str ) -> Any :
6758 """
6859 Parse the LLM response. For quiz generator, this returns the rephrased text.
6960 :param response: LLM response
7061 :return: Rephrased text
7162 """
72- return self .parse_rephrased_text (response )
63+
64+ def parse_rephrased_text (content : str ) -> str :
65+ """
66+ Parse the rephrased text from the response.
67+ :param content: LLM response content
68+ :return:
69+ """
70+ rephrased_text = content .strip ().strip ('"' )
71+ logger .debug ("Rephrased Text: %s" , rephrased_text )
72+ return rephrased_text
73+
74+ return parse_rephrased_text (response )
0 commit comments