ofermend commited on
Commit
4e3842f
1 Parent(s): 771e8d7

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +4 -2
  2. prompts.py +1 -1
app.py CHANGED
@@ -43,14 +43,16 @@ def launch_bot():
43
  language: str = Field(description='the language')
44
  ) -> str:
45
  """
46
- Rephrase the text to match the student's age, learning style and language
47
  """
48
  llm = OpenAI(model="gpt-4o", temperature=0)
 
49
  prompt = f'''
50
  The following is response the teacher is planning to provide to a student based on their question.
51
- Please adjust the response to match the student's age of {age}, the {style} teaching style and the {language} language.
52
  For example, in the inquiry-based teaching style, choose to ask questions that encourage the student to think critically instead of repsonding directly with the answer.
53
  Or in the socratic teaching style, choose to ask questions that lead the student to the answer.
 
54
  original response: {text}
55
  adjusted response:
56
  '''
 
43
  language: str = Field(description='the language')
44
  ) -> str:
45
  """
46
+ Rephrase the text to match the student's age, desired teaching style and language
47
  """
48
  llm = OpenAI(model="gpt-4o", temperature=0)
49
+ print(f"DEBUG: Adjusting response to student age {age}, style {style} and language {language}")
50
  prompt = f'''
51
  The following is response the teacher is planning to provide to a student based on their question.
52
+ Please adjust the response to match the student's age of {age}, the {style} teaching style.
53
  For example, in the inquiry-based teaching style, choose to ask questions that encourage the student to think critically instead of repsonding directly with the answer.
54
  Or in the socratic teaching style, choose to ask questions that lead the student to the answer.
55
+ Always respond in the {language} language.
56
  original response: {text}
57
  adjusted response:
58
  '''
prompts.py CHANGED
@@ -67,7 +67,7 @@ ADDITIONAL INSTRUCTIONS:
67
  - Make sure your response relies on the tools you have used and the information from those tools.
68
  - Do not base your response on information that was not provided by the tools.
69
  - The tool response may include citations in the form [1], [2], etc. Ignore these citations.
70
- - Always use the rephrase tool at the end in order to ensure it fits the student's age and the desired teaching style.
71
 
72
  ## Current Conversation
73
  Below is the current conversation consisting of interleaving student and assistant messages.
 
67
  - Make sure your response relies on the tools you have used and the information from those tools.
68
  - Do not base your response on information that was not provided by the tools.
69
  - The tool response may include citations in the form [1], [2], etc. Ignore these citations.
70
+ - Always use the rephrase tool at the end in order to ensure it fits the student's age, the desired teaching style and the language {language}
71
 
72
  ## Current Conversation
73
  Below is the current conversation consisting of interleaving student and assistant messages.