@@ -76,13 +76,15 @@ def __init__(
7676 publishedPartContent : Optional [str ] = None ,
7777 publishedPartAnswerContent : Optional [str ] = None ,
7878 publishedWorkedSolutionSections : Optional [List [dict ]] = [],
79+ publishedStructuredTutorialSections : Optional [List [dict ]] = [],
7980 publishedResponseAreas : Optional [List [Optional [ResponseAreaDetails ]]] = [],
8081 ):
8182 self .publishedPartId = publishedPartId
8283 self .publishedPartPosition = publishedPartPosition
8384 self .publishedPartContent = publishedPartContent
8485 self .publishedPartAnswerContent = publishedPartAnswerContent
8586 self .publishedWorkedSolutionSections = publishedWorkedSolutionSections
87+ self .publishedStructuredTutorialSections = publishedStructuredTutorialSections
8688 self .publishedResponseAreas = [ResponseAreaDetails (** publishedResponseArea ) for publishedResponseArea in publishedResponseAreas ]
8789
8890class QuestionDetails :
@@ -277,9 +279,20 @@ def _format_single_part(
277279 'content' : ws .get ('content' , '' ),
278280 'position' : ws .get ('position' , 0 )
279281 })
282+
283+ # 6. Structured Tutorial Sections
284+ tutorial_data = []
285+ if part .publishedStructuredTutorialSections :
286+ for ts in part .publishedStructuredTutorialSections :
287+ tutorial_data .append ({
288+ 'title' : ts .get ('title' , '' ),
289+ 'content' : ts .get ('content' , '' ),
290+ 'position' : ts .get ('position' , 0 )
291+ })
280292
281293 part_sections .append (PromptFormatter .format_worked_solutions (solutions_data ))
282-
294+ part_sections .append (PromptFormatter .format_structured_tutorials (tutorial_data ))
295+
283296 return "\n " .join (part_sections ) + "\n ---\n "
284297
285298
0 commit comments