keefereuther commited on
Commit
ca6e618
Β·
1 Parent(s): ae0a197

Update README to match production version and add manuscript information

Browse files
Files changed (2) hide show
  1. README.md +37 -34
  2. config.py +17 -6
README.md CHANGED
@@ -19,42 +19,38 @@ Schema Study is a modern, interactive study app designed to help biology student
19
 
20
  - **API Key Authentication:** Enter your OpenAI API key in the sidebar to enable chat functionality.
21
  - **Customizable Terms:** Use your own CSV file of terms and definitions.
22
- - **Prompt Templates:** Engage with the material using creative, research-based prompts.
23
- - **AI-Enhanced Feedback:** Get instant, formative feedback and guidance using GPT-5.1 (default) or GPT-4.1.
24
  - **Web Search Support:** Optional web search functionality for current information and citations (configurable in `config.py`).
25
  - **Real-Time Streaming:** Live token-by-token response streaming with visual typing indicator.
26
  - **Professional, Accessible UI:** Clean, modern design with a color palette for clarity and focus.
27
 
28
  ## How to Use (Students)
29
 
30
- 1. **Access the App:** Go to your Hugging Face Space URL.
31
- 2. **Enter API Key:** Provide your OpenAI API key in the sidebar configuration section.
32
- 3. **Select a Term:** Use the dropdown to pick a course term.
33
- 4. **Start Studying:** Respond to the prompt or use a template button to begin your session.
34
- 5. **Chat with the AI:** Ask questions, answer prompts, and explore the term in depth.
35
 
36
  ## How to Use (Instructors)
37
 
38
  ### Setup
39
 
40
  1. **Clone or Fork the Space:**
41
-
42
  ```bash
43
  git clone https://huggingface.co/spaces/<your-username>/<your-space-name>
44
  cd <your-space-name>
45
  ```
46
 
47
  2. **Edit Configuration:**
48
-
49
  - Update `config.py` for your course (title, instructions, prompt templates, etc).
50
  - Configure AI model settings:
51
- - `ai_model`: Choose "gpt-5.1" (default) or "gpt-4.1"
52
- - `reasoning_effort`: For GPT-5.1, set to "none" (fastest), "minimal", "low", or "medium"
53
  - `enable_web_search`: Set to `True` or `False` (default: True)
54
  - Place your terms CSV (e.g., `terms.csv`) in the root directory. Format: first column = term, second column = context/definition.
55
 
56
  3. **Set Secrets (Optional):**
57
-
58
  - If you want to use Streamlit secrets instead of sidebar API key input, create `.streamlit/secrets.toml` file locally or use Hugging Face Space secrets:
59
  ```toml
60
  OPENAI_API_KEY = "your_openai_api_key"
@@ -62,7 +58,6 @@ Schema Study is a modern, interactive study app designed to help biology student
62
  - For Hugging Face Spaces, go to **Settings > Repository secrets** and add the API key.
63
 
64
  4. **Push Changes:**
65
-
66
  ```bash
67
  git add .
68
  git commit -m "Update configuration and terms"
@@ -71,55 +66,63 @@ Schema Study is a modern, interactive study app designed to help biology student
71
 
72
  ### Model Selection Guide
73
 
74
- - **GPT-5.1** (default): Best for most use cases, fastest with reasoning="none", supports web search
 
75
  - **GPT-4.1**: Use if you need temperature control or prefer non-reasoning model, excellent web search support
76
 
77
  ## Configuration
78
 
79
  ### AI Model Settings (`config.py`)
80
 
81
- - **Default Model:** GPT-5.1 with reasoning="none" for faster responses
82
- - **Alternative Model:** GPT-4.1 with temperature control
83
  - **Web Search:** Configurable via `enable_web_search` (default: True)
84
- - **Reasoning Effort:** Configurable for GPT-5.1 (options: "none", "minimal", "low", "medium")
85
  - **Temperature:** Configurable for GPT-4.1 (0.0-2.0)
86
 
87
  ### Other Settings
88
 
89
- All settings are in `config.py` (title, instructions, prompt templates, resources, AI model parameters, etc).
90
-
91
- Theming is managed via `.streamlit/config.toml` and custom CSS in `app.py`.
92
-
93
- Dependencies are listed in `requirements.txt`.
94
 
95
  ## Technical Details
96
 
97
  ### API & Models
98
 
99
  - **API Framework:** OpenAI Responses API (streaming-enabled)
100
- - **Supported Models:** GPT-5.1 (default), GPT-4.1
101
- - **Streaming:** Real-time token-by-token response streaming with event-based handling
102
  - **Inactivity Guard:** Streaming stops after 60s of no server deltas
103
- - **Error Handling:** Comprehensive error handling for streaming events and recovery
104
 
105
  ### File Structure
106
 
107
- `app.py` β€” Main Streamlit app with Responses API integration
 
 
 
 
 
 
108
 
109
- `config.py` β€” All app settings and customization (model selection, web search, prompt templates)
110
 
111
- `.streamlit/secrets.toml` β€” Optional API key storage (not tracked in git)
112
 
113
- `requirements.txt` β€” Python dependencies
114
 
115
- `terms.csv` β€” Your course terms and definitions (CSV format: term, context)
116
 
117
- `BILD_5_Syllabus_Reuther_F25.pdf` β€” Example resource
118
 
119
- ## License
120
 
121
- This project is licensed under the GNU GPL-3 License. See the [LICENSE](LICENSE) file for details.
 
 
122
 
123
  ## Acknowledgments
124
 
125
- Developed by Keefe Reuther, Assistant Teaching Professor in the UC San Diego School of Biological Sciences. Special thanks to Dr. Liam O Mueller and the members of the Reuther Lab for their support and contributions.
 
 
 
19
 
20
  - **API Key Authentication:** Enter your OpenAI API key in the sidebar to enable chat functionality.
21
  - **Customizable Terms:** Use your own CSV file of terms and definitions.
22
+ - **Prompt Templates:** Engage with the material using creative, research-based prompts including midterm review.
23
+ - **AI-Enhanced Feedback:** Get instant, formative feedback and guidance using GPT-5.2 (default), GPT-5.1, or GPT-4.1.
24
  - **Web Search Support:** Optional web search functionality for current information and citations (configurable in `config.py`).
25
  - **Real-Time Streaming:** Live token-by-token response streaming with visual typing indicator.
26
  - **Professional, Accessible UI:** Clean, modern design with a color palette for clarity and focus.
27
 
28
  ## How to Use (Students)
29
 
30
+ 1. **Access the App:** Go to your Hugging Face Space URL. Enter your OpenAI API key in the sidebar configuration section.
31
+ 2. **Select a Term:** Use the dropdown to pick a course term.
32
+ 3. **Start Studying:** Respond to the prompt or use a template button to begin your session.
33
+ 4. **Chat with the AI:** Ask questions, answer prompts, and explore the term in depth.
 
34
 
35
  ## How to Use (Instructors)
36
 
37
  ### Setup
38
 
39
  1. **Clone or Fork the Space:**
 
40
  ```bash
41
  git clone https://huggingface.co/spaces/<your-username>/<your-space-name>
42
  cd <your-space-name>
43
  ```
44
 
45
  2. **Edit Configuration:**
 
46
  - Update `config.py` for your course (title, instructions, prompt templates, etc).
47
  - Configure AI model settings:
48
+ - `ai_model`: Choose "gpt-5.2" (default), "gpt-5.1", or "gpt-4.1"
49
+ - `reasoning_effort`: For GPT-5.2 and GPT-5.1, set to "none" (fastest), "minimal", "low", or "medium"
50
  - `enable_web_search`: Set to `True` or `False` (default: True)
51
  - Place your terms CSV (e.g., `terms.csv`) in the root directory. Format: first column = term, second column = context/definition.
52
 
53
  3. **Set Secrets (Optional):**
 
54
  - If you want to use Streamlit secrets instead of sidebar API key input, create `.streamlit/secrets.toml` file locally or use Hugging Face Space secrets:
55
  ```toml
56
  OPENAI_API_KEY = "your_openai_api_key"
 
58
  - For Hugging Face Spaces, go to **Settings > Repository secrets** and add the API key.
59
 
60
  4. **Push Changes:**
 
61
  ```bash
62
  git add .
63
  git commit -m "Update configuration and terms"
 
66
 
67
  ### Model Selection Guide
68
 
69
+ - **GPT-5.2** (default): Latest reasoning model, fastest with reasoning="none", supports web search
70
+ - **GPT-5.1**: Reasoning model with reasoning="none" default for faster responses, supports web search
71
  - **GPT-4.1**: Use if you need temperature control or prefer non-reasoning model, excellent web search support
72
 
73
  ## Configuration
74
 
75
  ### AI Model Settings (`config.py`)
76
 
77
+ - **Default Model:** GPT-5.2 with reasoning="none" for faster responses
78
+ - **Alternative Models:** GPT-5.1 (reasoning model) or GPT-4.1 (non-reasoning model with temperature control)
79
  - **Web Search:** Configurable via `enable_web_search` (default: True)
80
+ - **Reasoning Effort:** Configurable for GPT-5.2 and GPT-5.1 (options: "none", "minimal", "low", "medium")
81
  - **Temperature:** Configurable for GPT-4.1 (0.0-2.0)
82
 
83
  ### Other Settings
84
 
85
+ - All settings are in `config.py` (title, instructions, prompt templates, resources, AI model parameters, etc).
86
+ - Theming is managed via `.streamlit/config.toml` and custom CSS in `app.py`.
87
+ - Dependencies are listed in `requirements.txt`.
 
 
88
 
89
  ## Technical Details
90
 
91
  ### API & Models
92
 
93
  - **API Framework:** OpenAI Responses API (streaming-enabled)
94
+ - **Supported Models:** GPT-5.2 (default), GPT-5.1, GPT-4.1
95
+ - **Streaming:** Real-time token-by-token response streaming
96
  - **Inactivity Guard:** Streaming stops after 60s of no server deltas
 
97
 
98
  ### File Structure
99
 
100
+ - `app.py` β€” Main Streamlit app with Responses API integration
101
+ - `config.py` β€” All app settings and customization (model selection, web search, prompt templates, system prompt)
102
+ - `.streamlit/secrets.toml` β€” Optional authentication credentials and API key (not tracked in git)
103
+ - `requirements.txt` β€” Python dependencies
104
+ - `terms.csv` β€” Your course terms and definitions (CSV format: term, context)
105
+ - `example_syllabus.pdf` β€” Example resource file (replace with your own syllabus)
106
+ - `LICENSE` β€” GNU GPL-3 License file
107
 
108
+ ## License
109
 
110
+ This project is licensed under the GNU GPL-3 License. See the [LICENSE](LICENSE) file for details.
111
 
112
+ ## Research & Citation
113
 
114
+ This app, its corresponding manuscript, and all documentation was authored, edited, and tested by Keefe Reuther, [Liam O Mueller](https://biology.ucsd.edu/research/faculty/lomueller), Grace Constantian, Albert Nguyen, and the members of the Reuther Lab.
115
 
116
+ Schema Study was developed to address critical challenges in undergraduate biology education: providing immediate, personalized formative feedback to increasingly large, diverse classes. The app uses evidence-based teaching practices and Socratic questioning to deepen understanding, correct misconceptions, and encourage students to find connections among course concepts.
117
 
118
+ If you use this app in your research or teaching, please cite the associated manuscript:
119
 
120
+ **Reuther, K., Mueller, L. O., Constantian, G., & Nguyen, A. (2025). Schema Study: A Large Language Model (LLM) Application for Asynchronous Student Learning and Inquiry. *CourseSource Teaching Tools and Strategies*.**
121
+
122
+ The production version of this app can be found at [https://huggingface.co/spaces/keefereuther/Schema_Study](https://huggingface.co/spaces/keefereuther/Schema_Study).
123
 
124
  ## Acknowledgments
125
 
126
+ Developed by Keefe Reuther, Assistant Teaching Professor in the UC San Diego School of Biological Sciences. Special thanks to Dr. Liam O Mueller, Grace Constantian, Albert Nguyen, and the members of the Reuther Lab for their support and contributions.
127
+
128
+ For questions about creating your own version of this application for use in your classroom, please email kdreuther@ucsd.edu.
config.py CHANGED
@@ -183,6 +183,7 @@ resources = [
183
  # DO NOT REMOVE/EDIT anything inside the curly braces = '{selected_term}', '{selected_context}', '{term_list}'
184
  # These are placeholder variables that get filled in automatically by the app
185
 
 
186
  def term_prompt(selected_term, selected_context, term_list):
187
  return f"""You are Pliny 😊, a friendly and knowledgeable AI biology tutor for university students. Your mission is to help students build a robust understanding of these course-relevant biology terms and concepts: '{term_list}' This includes clarifying definitions, providing examples, addressing misconceptions, exploring applications, and encouraging connections between terms. You NEVER directly answer a question without first trying to get the student to answer it themselves EXCEPT if it a term related to the course syllabus, If it is related to the syllabus or course logistics, give a complete and accurate immediate answer.
188
 
@@ -190,19 +191,22 @@ def term_prompt(selected_term, selected_context, term_list):
190
 
191
  #### **Communication Style:**
192
  - Use clear, simple language and avoid unnecessary jargon.
193
- - Be succinct but make sure to respond to all statements made by the user.
194
- - Be approachable and professional.
 
195
  - Provide information step-by-step to manage cognitive load.
196
  - Use culturally inclusive examples and analogies that do not require advanced biological knowledge.
197
- - KEEP EACH RESPONSE SHORT.
198
 
199
  #### **Feedback and Encouragement:**
200
  - Offer constructive feedback and gently correct errors.
201
  - Acknowledge correct reasoning and reinforce a growth mindset by celebrating effort and progress.
202
  - Invite further questions to foster dialogue.
 
203
 
204
  #### **Expectations for Interaction:**
205
  - Unless there is a specific reason to do otherwise, you should assume the student is asking about '{selected_term}'.
 
206
 
207
  #### **Context-Driven Support:**
208
  - Always preferentially use the following information to guide your response: '{selected_context}'. Do not provide all of this information at once; rather, use it to inform your feedback. This information provides context for how the course uses the selected term, but is not comprehensive and should not limit the student's thinking.
@@ -210,8 +214,13 @@ def term_prompt(selected_term, selected_context, term_list):
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.
@@ -220,6 +229,7 @@ def term_prompt(selected_term, selected_context, term_list):
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.").
@@ -232,4 +242,5 @@ def term_prompt(selected_term, selected_context, term_list):
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
- """
 
 
183
  # DO NOT REMOVE/EDIT anything inside the curly braces = '{selected_term}', '{selected_context}', '{term_list}'
184
  # These are placeholder variables that get filled in automatically by the app
185
 
186
+
187
  def term_prompt(selected_term, selected_context, term_list):
188
  return f"""You are Pliny 😊, a friendly and knowledgeable AI biology tutor for university students. Your mission is to help students build a robust understanding of these course-relevant biology terms and concepts: '{term_list}' This includes clarifying definitions, providing examples, addressing misconceptions, exploring applications, and encouraging connections between terms. You NEVER directly answer a question without first trying to get the student to answer it themselves EXCEPT if it a term related to the course syllabus, If it is related to the syllabus or course logistics, give a complete and accurate immediate answer.
189
 
 
191
 
192
  #### **Communication Style:**
193
  - Use clear, simple language and avoid unnecessary jargon.
194
+ - Be warm, friendly, and engaging while maintaining professionalism. Remember you are Pliny 😊 - a personable tutor, not a clinical textbook.
195
+ - Be concise but not terse - include brief, friendly introductions or transitions that make the conversation feel natural and supportive.
196
+ - Make sure to respond to all statements made by the user with appropriate acknowledgment.
197
  - Provide information step-by-step to manage cognitive load.
198
  - Use culturally inclusive examples and analogies that do not require advanced biological knowledge.
199
+ - Keep responses focused and avoid unnecessary length, but don't sacrifice warmth and engagement for brevity.
200
 
201
  #### **Feedback and Encouragement:**
202
  - Offer constructive feedback and gently correct errors.
203
  - Acknowledge correct reasoning and reinforce a growth mindset by celebrating effort and progress.
204
  - Invite further questions to foster dialogue.
205
+ - When responding to button template activities (e.g., "Two Truths & a Lie", "Connect Terms"), maintain your friendly, engaging personality. Add brief, warm introductions or transitions rather than jumping straight into the activity. Make the interaction feel like a supportive conversation, not a clinical quiz.
206
 
207
  #### **Expectations for Interaction:**
208
  - Unless there is a specific reason to do otherwise, you should assume the student is asking about '{selected_term}'.
209
+ - **When providing examples:** If explicitly asked to provide an example scenario connecting specific terms (even if those terms are not in the course term list), provide the example as requested. This is for demonstration purposes to show the student how to create connections.
210
 
211
  #### **Context-Driven Support:**
212
  - Always preferentially use the following information to guide your response: '{selected_context}'. Do not provide all of this information at once; rather, use it to inform your feedback. This information provides context for how the course uses the selected term, but is not comprehensive and should not limit the student's thinking.
 
214
  #### **Critical Thinking and Engagement (PACING RULES):**
215
  - Assess and help build the student's understanding of the term '{selected_term}'.
216
  - **Context-Aware Scenario Inclusion:** Read the student's message carefully to determine if including an applied scenario makes sense:
217
+ - **For multi-part requests:** If the message has multiple parts (e.g., "First, give me an example... Second, prompt me to create..."), handle each part appropriately:
218
+ - **DO provide a scenario** for parts that explicitly ask for an example or demonstration (e.g., "give me an example of how to connect 'bats' and 'nitrogen'")
219
+ - **DO NOT provide a scenario** for parts where the student is asked to create their own (e.g., "prompt me to create a logical applied scenario" combined with "DO NOT provide me with an applied scenario")
220
+ - **For single requests:**
221
+ - **DO provide a scenario** if the message explicitly asks you to provide an example or demonstration (e.g., "give me an example", "show me how to connect", "provide an example scenario")
222
+ - **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")
223
+ - **DO NOT include a scenario** if the message asks the student to create their own scenario
224
  - **DO include a scenario** in normal conversational contexts where it helps illustrate the concept and guide the student's thinking
225
  - **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.
226
  - **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.
 
229
  - 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).
230
 
231
  #### **Response Clarity and Continuity:**
232
+ - Maintain a warm, engaging tone throughout your response. Even when presenting activities or questions, include brief, friendly context or transitions (e.g., "Great! Let's test your understanding with this challenge..." or "Here are three statements about natural selection for you to evaluate...")
233
  - End the message with your **single** Socratic question.
234
  - **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?").
235
  - **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.").
 
242
  - 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.
243
 
244
  By following these instructions, you will provide clear and relevant guidance, helping students learn effectively while maintaining the course's academic integrity.
245
+ """
246
+