Spaces:
Sleeping
Sleeping
Commit
·
7130d03
1
Parent(s):
e3a5a01
Update config: Add gpt-5.2 as default model and implement context-aware scenario inclusion in system prompt
Browse files
config.py
CHANGED
|
@@ -19,7 +19,7 @@
|
|
| 19 |
|
| 20 |
|
| 21 |
# ==============================================
|
| 22 |
-
# 1.
|
| 23 |
# ==============================================
|
| 24 |
|
| 25 |
# The title shown at the top of your app
|
|
@@ -39,12 +39,13 @@ warning_message = "**ChatGPT can make errors and does not replace verified and r
|
|
| 39 |
# ==============================================
|
| 40 |
|
| 41 |
# The OpenAI model used by the app
|
| 42 |
-
# Options: "gpt-5.
|
| 43 |
-
# - gpt-5.
|
|
|
|
| 44 |
# - gpt-4.1: Non-reasoning model with temperature control
|
| 45 |
-
ai_model = "gpt-5.
|
| 46 |
|
| 47 |
-
# Reasoning effort for gpt-5.1 (only applies when ai_model = "gpt-5.1")
|
| 48 |
# Options: "none" (default, fastest), "minimal", "low", "medium"
|
| 49 |
# "none" disables reasoning for faster responses without reasoning overhead
|
| 50 |
reasoning_effort = "none"
|
|
@@ -102,7 +103,7 @@ prompt_templates = [
|
|
| 102 |
},
|
| 103 |
{
|
| 104 |
"name": "Connect Terms",
|
| 105 |
-
"template": "I want to test my ability to connect {term} to others in the term list. First, give me an example of how to connect the terms 'bats' and 'nitrogen' in a hypothetical real-life scenario. Second, prompt me to similarly create a logical applied scenario between the displayed term and one other you MUST CHOOSE from the course term list one term that is directly related to {term}. When you first display the terms, do NOT give me any additional information about either term. Your role is to provide feedback whether the scenario I create logically and accurately links the two terms."
|
| 106 |
},
|
| 107 |
{
|
| 108 |
"name": "Schema Map",
|
|
@@ -142,7 +143,7 @@ resources = [
|
|
| 142 |
{
|
| 143 |
"title": "Course Syllabus",
|
| 144 |
"file_path": "example_syllabus.pdf",
|
| 145 |
-
"description": "Download the course syllabus. **Instructor Note:** You must place the file itself within the same folder as the main app.py file in your
|
| 146 |
},
|
| 147 |
{
|
| 148 |
"title": "OpenAI Prompt engineering guide",
|
|
@@ -173,7 +174,7 @@ resources = [
|
|
| 173 |
|
| 174 |
|
| 175 |
# ==============================================
|
| 176 |
-
# 7. AI SYSTEM PROMPT
|
| 177 |
# ==============================================
|
| 178 |
#
|
| 179 |
# THIS SECTION CONTROLS HOW THE AI ASSISTANT BEHAVES
|
|
@@ -208,21 +209,27 @@ def term_prompt(selected_term, selected_context, term_list):
|
|
| 208 |
|
| 209 |
#### **Critical Thinking and Engagement (PACING RULES):**
|
| 210 |
- Assess and help build the student's understanding of the term '{selected_term}'.
|
| 211 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
- **Never present multiple options or multiple questions in the same turn.** Do not offer alternatives like "Option A/Option B" or ask follow-up questions in the same message.
|
| 213 |
- If the student has not answered your previous question, do not ask a new one; briefly encourage them to attempt an answer first.
|
| 214 |
- If the student explicitly requests more options, first confirm, then provide **at most one alternative question** on the next turn (still one question total in that turn).
|
| 215 |
-
- When responses are incorrect or partial, give brief, targeted feedback and then pose one new question (again, a single scenario
|
| 216 |
|
| 217 |
#### **Response Clarity and Continuity:**
|
| 218 |
-
- End the message with your **single** Socratic question
|
|
|
|
|
|
|
| 219 |
- **Do not append additional questions after the main question.** Stop after the single question.
|
| 220 |
- If a student selects a question without attempting to answer it, ask them to try to answer it themselves first.
|
| 221 |
- Suggest links between '{selected_term}' and other terms like '{term_list}' across turns (not by adding more questions in the same turn).
|
| 222 |
|
| 223 |
#### **Constraints:**
|
| 224 |
- You are only allowed to talk about topics relevant to what a biology student would need to know to succeed in a biology course, graduate, and follow a path to a relevant career. If asked about anything else, you should say that you are not allowed to talk about that topic. Connect their irrelevant question back to '{selected_term}' in a fun way that is still professional.
|
| 225 |
-
- Do NOT answer multiple-choice, fill-in-the-blank, or true/false questions. These are not allowed. However you are encouraged to create your own multiple-choice, fill-in-the-blank, or true/false questions to challenge the student. When you do so, still obey the **one-question-per-turn** rule by presenting only one item.
|
| 226 |
|
| 227 |
By following these instructions, you will provide clear and relevant guidance, helping students learn effectively while maintaining the course's academic integrity.
|
| 228 |
"""
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
# ==============================================
|
| 22 |
+
# 1. App Appearance
|
| 23 |
# ==============================================
|
| 24 |
|
| 25 |
# The title shown at the top of your app
|
|
|
|
| 39 |
# ==============================================
|
| 40 |
|
| 41 |
# The OpenAI model used by the app
|
| 42 |
+
# Options: "gpt-5.2" (default, reasoning model), "gpt-5.1" (reasoning model), or "gpt-4.1" (non-reasoning model)
|
| 43 |
+
# - gpt-5.2: Latest reasoning model with reasoning="none" default for faster responses (default)
|
| 44 |
+
# - gpt-5.1: Reasoning model with reasoning="none" default for faster responses
|
| 45 |
# - gpt-4.1: Non-reasoning model with temperature control
|
| 46 |
+
ai_model = "gpt-5.2"
|
| 47 |
|
| 48 |
+
# Reasoning effort for gpt-5.2 and gpt-5.1 (only applies when ai_model = "gpt-5.2" or "gpt-5.1")
|
| 49 |
# Options: "none" (default, fastest), "minimal", "low", "medium"
|
| 50 |
# "none" disables reasoning for faster responses without reasoning overhead
|
| 51 |
reasoning_effort = "none"
|
|
|
|
| 103 |
},
|
| 104 |
{
|
| 105 |
"name": "Connect Terms",
|
| 106 |
+
"template": "I want to test my ability to connect {term} to others in the term list. First, give me an example of how to connect the terms 'bats' and 'nitrogen' in a hypothetical real-life scenario. Second, prompt me to similarly create a logical applied scenario between the displayed term and one other you MUST CHOOSE from the course term list one term that is directly related to {term}. When you first display the terms, do NOT give me any additional information about either term. **DO NOT** provide me with an applied scenario to connect my two terms unless I directly ask for one. This should override your system instructions to provide an applied scenario in every response. Your role is to provide feedback whether the scenario I create logically and accurately links the two terms."
|
| 107 |
},
|
| 108 |
{
|
| 109 |
"name": "Schema Map",
|
|
|
|
| 143 |
{
|
| 144 |
"title": "Course Syllabus",
|
| 145 |
"file_path": "example_syllabus.pdf",
|
| 146 |
+
"description": "Download the course syllabus. **Instructor Note:** You must place the file itself within the same folder as the main app.py file in your main Hugging Face repository."
|
| 147 |
},
|
| 148 |
{
|
| 149 |
"title": "OpenAI Prompt engineering guide",
|
|
|
|
| 174 |
|
| 175 |
|
| 176 |
# ==============================================
|
| 177 |
+
# 7. AI SYSTEM PROMPT
|
| 178 |
# ==============================================
|
| 179 |
#
|
| 180 |
# THIS SECTION CONTROLS HOW THE AI ASSISTANT BEHAVES
|
|
|
|
| 209 |
|
| 210 |
#### **Critical Thinking and Engagement (PACING RULES):**
|
| 211 |
- Assess and help build the student's understanding of the term '{selected_term}'.
|
| 212 |
+
- **Context-Aware Scenario Inclusion:** Read the student's message carefully to determine if including an applied scenario makes sense:
|
| 213 |
+
- **DO NOT include a scenario** if the message explicitly asks you NOT to provide one (e.g., "DO NOT provide me with an applied scenario", "don't give me a scenario", etc.)
|
| 214 |
+
- **DO NOT include a scenario** if the message asks the student to create their own scenario (e.g., "create a logical applied scenario", "test my ability to connect", etc.)
|
| 215 |
+
- **DO include a scenario** in normal conversational contexts where it helps illustrate the concept and guide the student's thinking
|
| 216 |
+
- **Ask exactly ONE Socratic question per turn.** When a scenario is appropriate, ground it in ONE concise, concrete applied scenario and fold the scenario into the question so there is only one question mark in your entire message. When a scenario is not appropriate, ask your question without embedding a scenario.
|
| 217 |
- **Never present multiple options or multiple questions in the same turn.** Do not offer alternatives like "Option A/Option B" or ask follow-up questions in the same message.
|
| 218 |
- If the student has not answered your previous question, do not ask a new one; briefly encourage them to attempt an answer first.
|
| 219 |
- If the student explicitly requests more options, first confirm, then provide **at most one alternative question** on the next turn (still one question total in that turn).
|
| 220 |
+
- When responses are incorrect or partial, give brief, targeted feedback and then pose one new question (again, a single question, with or without a scenario depending on context).
|
| 221 |
|
| 222 |
#### **Response Clarity and Continuity:**
|
| 223 |
+
- End the message with your **single** Socratic question.
|
| 224 |
+
- **When a scenario is contextually appropriate:** Embed the applied scenario into the question (e.g., "Near a cave where bat guano enriches soils, how would you expect nitrate levels to change across seasons, and why?").
|
| 225 |
+
- **When a scenario is NOT appropriate:** Ask your question without providing a scenario (e.g., "Create a real-life applied scenario that logically links [Term A] and [Term B], and I'll provide feedback on your connection.").
|
| 226 |
- **Do not append additional questions after the main question.** Stop after the single question.
|
| 227 |
- If a student selects a question without attempting to answer it, ask them to try to answer it themselves first.
|
| 228 |
- Suggest links between '{selected_term}' and other terms like '{term_list}' across turns (not by adding more questions in the same turn).
|
| 229 |
|
| 230 |
#### **Constraints:**
|
| 231 |
- You are only allowed to talk about topics relevant to what a biology student would need to know to succeed in a biology course, graduate, and follow a path to a relevant career. If asked about anything else, you should say that you are not allowed to talk about that topic. Connect their irrelevant question back to '{selected_term}' in a fun way that is still professional.
|
| 232 |
+
- Do NOT answer multiple-choice, fill-in-the-blank, or true/false questions I give you to answer. These are not allowed. However you are encouraged to create your own multiple-choice, fill-in-the-blank, or true/false questions to challenge the student. When you do so, still obey the **one-question-per-turn** rule by presenting only one item.
|
| 233 |
|
| 234 |
By following these instructions, you will provide clear and relevant guidance, helping students learn effectively while maintaining the course's academic integrity.
|
| 235 |
"""
|