# config.py # # ====================================================================== # SETTINGS FOR THE SCHEMA STUDY APP # ====================================================================== # # This file contains all the customizable settings for your app. # If you're not familiar with programming, don't worry! Just follow # the instructions next to each setting and edit the values between # the quotation marks or after the equals sign. # # IMPORTANT: # - DO NOT remove any quotation marks or equals signs # - DO NOT change any variable names (the words before the equals sign) # - DO NOT delete any lines or sections # - Keep your file in the same folder as app.py # # ====================================================================== # ============================================== # 1. App Appearance # ============================================== # The title shown at the top of your app app_title = "Schema Study" # The file containing your terms and their definitions # This must be a CSV file in the same folder as app.py # The CSV file should have two columns: first column for terms, second column for context default_terms_csv = "terms.csv" # Warning message shown at the bottom of the chat window warning_message = "**ChatGPT can make errors and does not replace verified and reputable online and classroom resources. Do NOT enter any private, confidential, or personally identifiable information.**" # ============================================== # 2. AI MODEL SETTINGS # ============================================== # The OpenAI model used by the app # Options: "gpt-5.2" (default, reasoning model), "gpt-5.1" (reasoning model), or "gpt-4.1" (non-reasoning model) # - gpt-5.2: Latest reasoning model with reasoning="none" default for faster responses (default) # - gpt-5.1: Reasoning model with reasoning="none" default for faster responses # - gpt-4.1: Non-reasoning model with temperature control ai_model = "gpt-5.2" # Reasoning effort for gpt-5.2 and gpt-5.1 (only applies when ai_model = "gpt-5.2" or "gpt-5.1") # Options: "none" (default, fastest), "minimal", "low", "medium" # "none" disables reasoning for faster responses without reasoning overhead reasoning_effort = "none" # Temperature for gpt-4.1 (only applies when ai_model = "gpt-4.1") # Controls randomness/creativity (0-2) # Lower values (0.1-0.3) = more focused, precise responses # Higher values (0.7-1.0) = more creative, varied responses temperature = 0.1 # Maximum length of AI responses (measured in tokens) # Higher values allow for longer responses (1000-2000 is usually sufficient) # Maps to max_output_tokens in Responses API max_tokens = 1000 # Enable web search functionality (only applies when ai_model supports web search) # When enabled, the AI can search the web for current information and cite sources # Note: Web search is incompatible with reasoning effort - reasoning will be disabled automatically # Options: True (enabled) or False (disabled, default) enable_web_search = True # ============================================== # 3. STUDENT INSTRUCTIONS # ============================================== # Instructions displayed to students when they click the instructions expander instructions = ''' The goal of this app is to help you learn and and assess your knowledge of core course concepts and examples. 1. Choose a course term/phrase from the drop down menu. 2. *Pause and think for 30 seconds.* What is everything you associate with this term/phrase? What is a simple definition or example? 3. Write as little or as much as you'd like about it. Try to include anything you might need to know for an exam. 4. Please follow-up with questions. If you don't know something, just ask. It is perfectly ok to write: "I have no idea what this term means." **Have a conversation!** ''' # ============================================== # 4. PROMPT TEMPLATE BUTTONS # ============================================== # These templates appear as buttons students can click to start different types of activities # Each template has a "name" (shown on the button) and a "template" (the text sent when clicked) # You can edit the existing templates or add new ones following the same format # The {term} will be replaced with the selected term from the dropdown # The {term_list} will be replaced with the list of all terms prompt_templates = [ { "name": "Misconception Check", "template": "What are some common misconceptions about {term}? Help me identify and correct them by asking me multiple choice questions." }, { "name": "Two Truths & a Lie", "template": "Tell me two truths and one lie about {term}. I'll try to identify the lie and explain my reasoning." }, { "name": "Connect Terms", "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." }, { "name": "Schema Map", "template": "What are all the direct connections between {term} and the other terms among {term_list}? Help me create a concept map for {term}." }, { "name": "Create a Study Plan", "template": "Please ask me about what assessments I have coming up. You will then ask me simple questions about what I need to know to do well on the assessment and surmise my study preferences. You will then help me create a scaffolded, spaced-repetition study plan to gain the mastery needed to do well on the assessment at all levels of Bloom's taxonomy." } ] # ============================================== # 5. ATTRIBUTION AND LICENSE # ============================================== # Information about who created the app (appears in the sidebar) app_creation_message = "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), and the members of the Reuther Lab - [https://keefereuther.com](https://keefereuther.com)" # License and repository information (appears in the sidebar) app_repo_license_message = "It can be found at [https://huggingface.co/spaces/keefereuther/Schema_Study_Preview](https://huggingface.co/spaces/keefereuther/Preview) and is distributed under the GNU GPL-3 License. If you are interested in creating your own version of this application for use in your classroom, please email kdreuther@ucsd.edu for more information. The non-preview version can be found at [https://huggingface.co/spaces/keefereuther/Schema_Study](https://huggingface.co/spaces/keefereuther/Schema_Study)." # ============================================== # 6. RESOURCES LIST # ============================================== # Resources shown in the sidebar that students can access # You can add/remove/edit resources # Each resource can have: # - "title": The name of the resource shown in the sidebar # - "url": Link to an external website (optional) # - "file_path": Path to a downloadable file in your app folder (optional) # - "description": Text explaining the resource resources = [ { "title": "Course Syllabus", "file_path": "example_syllabus.pdf", "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." }, { "title": "OpenAI Prompt engineering guide", "url": "https://platform.openai.com/docs/guides/prompt-engineering/six-strategies-for-getting-better-results", "description": "A guide to help you craft effective prompts for the OpenAI chatbot. It includes best practices and examples to improve the quality of responses." }, { "title": "UC Berkeley Library Guide to Detecting Fake News", "url": "https://guides.lib.berkeley.edu/fake-news", "description": "This UC Berkeley Library guide offers comprehensive strategies and resources for identifying fake news, understanding its impact, and evaluating the credibility of various news sources, including lists of known fake news sites and tips for detecting misinformation." }, { "title": "Is it cheating to use ChatGPT?", "url": "https://academicintegrity.ucsd.edu/excel-integrity/gen-ai/ai-in-education.html", "description": "The UC San Diego Academic Integrity Office provides guidance on the appropriate use of generative AI tools in educational settings, emphasizing the importance of adhering to instructor guidelines and the potential consequences of misuse, including integrity violations and academic penalties." }, { "title": "OpenStax - Biology", "url": "https://openstax.org/details/books/biology", "description": "Provides free, peer-reviewed, openly licensed textbooks for introductory college and AP-level biology courses." }, { "title": "Scitable by Nature Education", "url": "https://www.nature.com/scitable", "description": "A free science library and personal learning tool focusing on genetics, cell biology, and related topics. It offers articles, eBooks, and educational resources from experts and is part of Nature Education." } ] # ============================================== # 7. AI SYSTEM PROMPT # ============================================== # # THIS SECTION CONTROLS HOW THE AI ASSISTANT BEHAVES # Only edit this if you know what you're doing! # # DO NOT REMOVE/EDIT anything inside the curly braces = '{selected_term}', '{selected_context}', '{term_list}' # These are placeholder variables that get filled in automatically by the app def term_prompt(selected_term, selected_context, term_list): 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. **Guidelines:** #### **Communication Style:** - Use clear, simple language and avoid unnecessary jargon. - Be warm, friendly, and engaging while maintaining professionalism. Remember you are Pliny 😊 - a personable tutor, not a clinical textbook. - Be concise but not terse - include brief, friendly introductions or transitions that make the conversation feel natural and supportive. - Make sure to respond to all statements made by the user with appropriate acknowledgment. - Provide information step-by-step to manage cognitive load. - Use culturally inclusive examples and analogies that do not require advanced biological knowledge. - Keep responses focused and avoid unnecessary length, but don't sacrifice warmth and engagement for brevity. #### **Feedback and Encouragement:** - Offer constructive feedback and gently correct errors. - Acknowledge correct reasoning and reinforce a growth mindset by celebrating effort and progress. - Invite further questions to foster dialogue. - 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. #### **Expectations for Interaction:** - Unless there is a specific reason to do otherwise, you should assume the student is asking about '{selected_term}'. - **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. #### **Context-Driven Support:** - 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. #### **Critical Thinking and Engagement (PACING RULES):** - Assess and help build the student's understanding of the term '{selected_term}'. - **Context-Aware Scenario Inclusion:** Read the student's message carefully to determine if including an applied scenario makes sense: - **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: - **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'") - **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") - **For single requests:** - **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") - **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") - **DO NOT include a scenario** if the message asks the student to create their own scenario - **DO include a scenario** in normal conversational contexts where it helps illustrate the concept and guide the student's thinking - **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. - **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. - If the student has not answered your previous question, do not ask a new one; briefly encourage them to attempt an answer first. - 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). - 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). #### **Response Clarity and Continuity:** - 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...") - End the message with your **single** Socratic question. - **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?"). - **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."). - **Do not append additional questions after the main question.** Stop after the single question. - If a student selects a question without attempting to answer it, ask them to try to answer it themselves first. - Suggest links between '{selected_term}' and other terms like '{term_list}' across turns (not by adding more questions in the same turn). #### **Constraints:** - 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. - 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. By following these instructions, you will provide clear and relevant guidance, helping students learn effectively while maintaining the course's academic integrity. """