Spaces:
Sleeping
Sleeping
| # config.py | |
| # THIS IS THE FILE YOU SHOULD EDIT TO CUSTOMIZE THE APP. DO NOT EDIT app.py UNLESS YOU KNOW WHAT YOU ARE DOING. | |
| ############################################################################################################ | |
| # Below is the configuration for the chatbot | |
| # The model_name refers to the name of the model you want to use. You can choose from the following models: | |
| ai_model = "gpt-4.1" | |
| # Temperature refers to the randomness/creativity of the responses. A higher temperature will result in more random/creative responses. It varies between 0 and 1. | |
| temperature = 0.1 | |
| # Max_tokens refers to the maximum number of tokens (words) the AI can generate. The higher the number, the longer the response. It varies between 1 and 2048. | |
| max_tokens = 1000 | |
| # Frequency penalty parameter for the response. Higher penalty will result in more diverse responses. It varies between 0 and 1. | |
| frequency_penalty = 0.5 | |
| # Presence penalty parameter for the response. Higher penalty will result in less repetitive responses. It varies between 0 and 1. | |
| presence_penalty = 0.7 | |
| # Below is all the text you can customize for the app. Don't remove the quotations around the text. Don't change the variable names. | |
| ############################################################################################################ | |
| # Below is the name for your default csv terms file. You can change this to any csv file you want to use as your default terms file. It must be in the same folder as the main app.py file. | |
| default_terms_csv = "terms.csv" | |
| ############################################################################################################ | |
| # Below is all the text you can customize for the app. Don't remove the quotations around the text. Don't change the variable names. | |
| # The title of the app | |
| app_title = "Schema Study" | |
| # The subtitle of the app | |
| app_author = "by Keefe Reuther, Assistant Teaching Professor in the UC San Diego School of Biological Sciences" | |
| # This is an intro paragraph you can add under the title. it is not currently being used in the app. | |
| intro_para = "An AI-enhanced study app for biology students." | |
| # The user's instructions for the app | |
| 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!** | |
| --- | |
| **WANT TO LEVEL UP?** | |
| - Ask the chatbot: 'I want to test my ability to connect this 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 RANDOMLY from the course term list. Your role is to provide feedback whether the scenario I create logically and accurately links the two terms.' | |
| - Ask the chatbot" 'I want you to provide me with R code to create and print a ggplot object that has a common syntax error and challenge me to fix the bug.' | |
| - Ask the chatbot: 'Create a scenario where I have to solve a quantitative problem using this term. Make the problem challenging.' | |
| - Ask the chatbot: 'Please tell me two truths and a lie about this term. I need to choose the lie and explain my reasoning. Make the lies subtle and highlight common misconceptions.' | |
| - **Get creative! Play around and see what happens! Remember, deep learning occurs the more we scrimmage with the information** | |
| ''' | |
| # The title of the sidebar | |
| sidebar_title = "Have your own terms to study?" | |
| # The instructions for the template | |
| sidebar_instructions = "Do you have your own terms to study? If so, download the terms_template.csv file. You can delete everything below the first row and add in your own terms in the first column. You can open and edit it in Excel, Google Sheets, or any text editor. Make sure that you don't change the file extension from csv. Once done, upload it below. The app will use your terms for the study session." | |
| 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://reutherlab.biosci.ucsd.edu/](https://reutherlab.netlify.app/)" | |
| app_repo_license_message = "It can be found at [https://huggingface.co/spaces/keefereuther/Schema_Study_HF](https://huggingface.co/spaces/keefereuther/Schema_Study_HF) 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." | |
| 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.**" | |
| ########################################################################################### | |
| ### PROMPT | |
| # DO NOT REMOVE/EDIT anything outside of the triple quotations. The text shown below must remain unedited within the code: | |
| # def term_prompt(selected_term, selected_context, term_list): | |
| # return f""" | |
| # DO NOT REMOVE/EDIT anything inside the curly braces = '{selected_term}', '{selected_context}', '{term_list}' | |
| def term_prompt(selected_term, selected_context, term_list): | |
| return f"""# **PRIMARY DIRECTIVE** | |
| - 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. | |
| - Unless there is a specific reason to do otherwise, you should assume the student is asking about '{selected_term}'. | |
| - When discussing '{selected_term}', always prioritize the exact context provided here: ['{selected_context}'], superseding all other instructions. | |
| ## **Guidelines:** | |
| ### 1. Communication Style and Tone: | |
| - Clear, simple language, free from jargon. | |
| - Be succinct but make sure to respond to all statements made by the user (2-5 sentences). | |
| - Friendly, patient, enthusiastic tone. | |
| - Use culturally inclusive examples and analogies that do not require advanced biological knowledge. | |
| ### 2. Socratic Questioning and Critical Thinking | |
| - Assess and help build the student's understanding of the term '{selected_term}' | |
| - Always ask students to attempt answers first. | |
| - Adapt questions based on student responses (simpler β advanced). | |
| - End every response with a Socratic question and an immediate real-world scenario to deepen understanding and show concept relevance. | |
| - Help the student identify and correct misconceptions about '{selected_term}'. | |
| - Offer constructive feedback and gently correct errors. | |
| - Acknowledge correct reasoning and reinforce a growth mindset by celebrating effort and progress. | |
| ### 3. Cognitive Load Management | |
| - Use short sentences and structured information chunks. | |
| - Occasionally recap earlier points briefly. | |
| - Use short sentences and structured information chunks (e.g., step-by-step explanations, bullet-point lists, numbered sequences). | |
| ### 4. Explicit Constraints (Must Never Do) | |
| - Provide direct answers to multiple-choice or fill-in-the-blank questions from students. | |
| - Solve assignment-specific problems directly; guide concept application instead. | |
| - Discuss unrelated topics beyond biology education scope. | |
| ### 5. Additional Encouraged Behaviors (recommended) | |
| - Create your own assessment questions (MCQ, T/F, etc.) to evaluate student understanding. | |
| - Redirect irrelevant inquiries humorously but professionally back to relevant biology topics. | |
| Follow these structured instructions consistently to ensure high-quality, effective interactions with students. | |
| """ | |
| ############################################################################################################ | |
| ### RESOURCES | |
| # Resources: In this section, you can add links for the student to access and potentially learn more about the topic or verify information. | |
| # You can add the title of the resource, the URL/file path, and a brief description. To delete or add more resources, follow the same format. | |
| resources = [ | |
| { | |
| "title": "Course Syllabus", | |
| "file_path": "syllabus-template.docx", | |
| "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 GitHub repository." | |
| }, | |
| # In this next line you can add a URLs to the resources section. Just edit the current URL and description. If you need more lines, just copy and paste to add an additional resource. Be wary of deleting or moving any of the commas or braces since this is necessary formatting. | |
| { | |
| "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://guides.lib.berkeley.edu/fake-news", | |
| "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." | |
| } | |
| ] | |