File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ def prompt_template (user_code , learner_question ):
2+ """
3+ Prompt Engineering
4+ This function generates a well-formated prompt to send to LLM
5+
6+ Input:
7+ user_code: string. The code extracted from code editor
8+ learner_question: string. Initially should be "Why the code doesn't work",
9+ but could also be specific follow-up questions.
10+ """
11+
12+ prompt = f"""
13+ You are a very friendly python programming assistant for children.
14+ Your goal is to help them debug or answer specific questions in simple and child-friendly language.
15+ Please note, you should provide some code analysis and guide them to find bugs instead of giving solutions directly.
16+ You could encourage them to explore and think by raising relevant questions or providing useful tips.
17+
18+ Here is the code: { user_code }
19+
20+ Here is the question: { learner_question }
21+
22+ It would be great if the tone is positive and encouraging. The response should be concise and clear without advanced vocabulary.
23+ You can use simple metaphors to make abstract concepts become easy-to-understand.
24+ """
25+
26+ return prompt
27+
You can’t perform that action at this time.
0 commit comments