joshuarauh commited on
Commit
60b557b
·
verified ·
1 Parent(s): 86e2004

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -836,16 +836,13 @@ def generate_question(subject, difficulty, question_type, subtopic=None, use_enh
836
  difficulty_params = get_difficulty_parameters(difficulty)
837
  problem_type_addition = get_problem_type_addition(question_type)
838
 
839
- system_prompt = f"""You are an expert mathematics professor creating a {difficulty_params['description']} exam question.
840
  STRICT REQUIREMENTS:
841
- 1. Write exactly 1 {question_type} question on {subject} covering {selected_topic} that can be solved analytically without numerical methods.
842
- - A question where any part of the solution must resort to numerical methods is invalid.
843
- - Begin the output with the text "Here is a test question that is a {question_type} question on {subject} covering {selected_topic}."
844
  2. Difficulty Level Guidelines:
845
  {difficulty_params['description'].upper()}
846
  Follow these specific constraints:
847
  {chr(10).join(f' - {c}' for c in difficulty_params['constraints'])}
848
-
849
  {problem_type_addition}
850
  3. Style Reference:
851
  Question should be {difficulty_params['example_style']}
@@ -978,10 +975,10 @@ make sure the question is CLEAR about what regions you intend to be included in
978
  message = anthropic.messages.create(
979
  model=difficulty_params['model'],
980
  max_tokens=4096,
981
- temperature=0.7,
982
  messages=[{
983
- "role": "user",
984
- "content": f"{system_prompt}\n\nWrite a question for {subject}."
985
  }]
986
  )
987
 
 
836
  difficulty_params = get_difficulty_parameters(difficulty)
837
  problem_type_addition = get_problem_type_addition(question_type)
838
 
839
+ system_prompt = f"""Write exactly one {question_type} exam question on {subject} covering {selected_topic} that can be solved analytically, without numerical methods.
840
  STRICT REQUIREMENTS:
841
+ 1. Begin the output with the text "Here is a test question that is a {question_type} question on {subject} covering {selected_topic}."
 
 
842
  2. Difficulty Level Guidelines:
843
  {difficulty_params['description'].upper()}
844
  Follow these specific constraints:
845
  {chr(10).join(f' - {c}' for c in difficulty_params['constraints'])}
 
846
  {problem_type_addition}
847
  3. Style Reference:
848
  Question should be {difficulty_params['example_style']}
 
975
  message = anthropic.messages.create(
976
  model=difficulty_params['model'],
977
  max_tokens=4096,
978
+ temperature=0.9,
979
  messages=[{
980
+ "role": "You are a mathematics professor",
981
+ "content": f"{system_prompt}"
982
  }]
983
  )
984