milwright commited on
Commit
722e654
·
verified ·
1 Parent(s): be05a11

Upload 4 files

Browse files
Files changed (3) hide show
  1. README.md +24 -7
  2. app.py +5 -5
  3. config.json +5 -5
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Course Assistant - CCNY Data Science
3
  emoji: 🤖
4
  colorFrom: blue
5
  colorTo: red
@@ -8,12 +8,12 @@ sdk_version: 5.38.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
- short_description: "assistant for prof. muhlbauer's data science course"
12
  ---
13
 
14
- # Course Assistant - CCNY Data Science
15
 
16
- assistant for prof. muhlbauer's data science course
17
 
18
  ## Quick Deploy to HuggingFace Spaces
19
 
@@ -40,22 +40,39 @@ assistant for prof. muhlbauer's data science course
40
  5. Value: Your OpenRouter API key
41
  6. Click "Add"
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
 
45
- ### Step 4: Get Your API Key
46
  1. Go to https://openrouter.ai/keys
47
  2. Sign up/login if needed
48
  3. Click "Create Key"
49
  4. Copy the key (starts with `sk-or-`)
50
 
51
- ### Step 5: Test Your Space
52
  - Go back to "App" tab
53
  - Your Space should be running!
54
  - Try the example prompts or ask a question
55
 
56
  ## Configuration
57
 
58
- - **Model**: google/gemini-2.0-flash-001
59
  - **Temperature**: 0.7
60
  - **Max Tokens**: 750
61
  - **API Key Variable**: OPENROUTER_API_KEY
 
1
  ---
2
+ title: CCNY Data Science Assistant
3
  emoji: 🤖
4
  colorFrom: blue
5
  colorTo: red
 
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
+ short_description: "Assistant for Foundations of Data Science at CCNY"
12
  ---
13
 
14
+ # CCNY Data Science Assistant
15
 
16
+ Assistant for Foundations of Data Science at CCNY
17
 
18
  ## Quick Deploy to HuggingFace Spaces
19
 
 
40
  5. Value: Your OpenRouter API key
41
  6. Click "Add"
42
 
43
+ ### Step 4: Configure Access Control
44
+ Your Space is configured with access code protection. Students will need to enter the access code to use the chatbot.
45
+
46
+ 1. Go to Settings (gear icon)
47
+ 2. Click "Variables and secrets"
48
+ 3. Click "New secret"
49
+ 4. Name: `SPACE_ACCESS_CODE`
50
+ 5. Value: `TLC`
51
+ 6. Click "Add"
52
+
53
+ **Important**: The access code is now stored securely as an environment variable and is not visible in your app code.
54
+
55
+ To disable access protection:
56
+ 1. Go to Settings → Variables and secrets
57
+ 2. Delete the `SPACE_ACCESS_CODE` secret
58
+ 3. The Space will rebuild automatically with no access protection
59
+
60
 
61
 
62
+ ### Step 5: Get Your API Key
63
  1. Go to https://openrouter.ai/keys
64
  2. Sign up/login if needed
65
  3. Click "Create Key"
66
  4. Copy the key (starts with `sk-or-`)
67
 
68
+ ### Step 6: Test Your Space
69
  - Go back to "App" tab
70
  - Your Space should be running!
71
  - Try the example prompts or ask a question
72
 
73
  ## Configuration
74
 
75
+ - **Model**: openai/gpt-4o-mini-search-preview
76
  - **Temperature**: 0.7
77
  - **Max Tokens**: 750
78
  - **API Key Variable**: OPENROUTER_API_KEY
app.py CHANGED
@@ -10,8 +10,8 @@ import urllib.parse
10
 
11
 
12
  # Configuration
13
- SPACE_NAME = "Course Assistant - CCNY Data Science"
14
- SPACE_DESCRIPTION = "assistant for prof. muhlbauer's data science course"
15
  SYSTEM_PROMPT = """You are a supportive course assistant for Professor Zach Muhlbauer's Foundations of Data Science course (CSC 10800 R) at City College of New York.
16
 
17
  Core Responsibilities
@@ -52,8 +52,8 @@ Engagement Style:
52
  * Celebrate student progress and effort
53
 
54
  Remember: Your goal is to support student learning and success while maintaining the pedagogical integrity of the course. You are a learning facilitator, not an answer provider."""
55
- MODEL = "google/gemini-2.0-flash-001"
56
- GROUNDING_URLS = ["https://zmuhls.github.io/ccny-data-science/schedule/", "https://zmuhls.github.io/ccny-data-science/syllabus/", "https://zmuhls.github.io/ccny-data-science/activities/", "https://zmuhls.github.io/ccny-data-science/portfolio/"]
57
  # Get access code from environment variable for security
58
  # If SPACE_ACCESS_CODE is not set, no access control is applied
59
  ACCESS_CODE = os.environ.get("SPACE_ACCESS_CODE")
@@ -551,7 +551,7 @@ with gr.Blocks(title=SPACE_NAME) as demo:
551
  fn=store_and_generate_response, # Use wrapper function to store history
552
  title="", # Title already shown above
553
  description="", # Description already shown above
554
- examples=['When is the social coding portfolio due?'],
555
  type="messages" # Use modern message format for better compatibility
556
  )
557
 
 
10
 
11
 
12
  # Configuration
13
+ SPACE_NAME = "CCNY Data Science Assistant"
14
+ SPACE_DESCRIPTION = "Assistant for Foundations of Data Science at CCNY"
15
  SYSTEM_PROMPT = """You are a supportive course assistant for Professor Zach Muhlbauer's Foundations of Data Science course (CSC 10800 R) at City College of New York.
16
 
17
  Core Responsibilities
 
52
  * Celebrate student progress and effort
53
 
54
  Remember: Your goal is to support student learning and success while maintaining the pedagogical integrity of the course. You are a learning facilitator, not an answer provider."""
55
+ MODEL = "openai/gpt-4o-mini-search-preview"
56
+ GROUNDING_URLS = ["https://zmuhls.github.io/ccny-data-science/schedule/", "https://zmuhls.github.io/ccny-data-science/schedule/", "https://zmuhls.github.io/ccny-data-science/portfolio/", "https://zmuhls.github.io/ccny-data-science/activities/"]
57
  # Get access code from environment variable for security
58
  # If SPACE_ACCESS_CODE is not set, no access control is applied
59
  ACCESS_CODE = os.environ.get("SPACE_ACCESS_CODE")
 
551
  fn=store_and_generate_response, # Use wrapper function to store history
552
  title="", # Title already shown above
553
  description="", # Description already shown above
554
+ examples=['When is the social coding portfolio due?', "What's my grade in the course?"],
555
  type="messages" # Use modern message format for better compatibility
556
  )
557
 
config.json CHANGED
@@ -1,12 +1,12 @@
1
  {
2
- "name": "Course Assistant - CCNY Data Science",
3
- "description": "assistant for prof. muhlbauer's data science course",
4
  "system_prompt": "You are a supportive course assistant for Professor Zach Muhlbauer's Foundations of Data Science course (CSC 10800 R) at City College of New York.\n\nCore Responsibilities\n* Course Navigation: Help students locate and understand syllabus information, assignment details, schedules, readings, and course materials\n* Learning Facilitation: Guide students toward understanding concepts through Socratic questioning and scaffolding rather than providing direct answers\n* Administrative Support: Provide accurate information about deadlines, exam dates, office hours, and course policies\n\nResponse Guidelines\n* Precision First: Be exact with all dates, times, deadlines, and scheduling information\n* Warm Tone: Use encouraging, supportive language that builds student confidence\n* Pedagogical Approach: Never provide direct answers to assignments or assessments; instead, ask guiding questions that help students discover solutions independently\n* Scope Boundaries: Only address questions related to this specific course (CSC 10800 R) - syllabus, schedule, assignments, readings, and general data science learning support\n* Specific Protocols: For questions about grades, redirect students to contact Professor Muhlbauer at the email provided in the course materials for all related inquiries: [email protected]\n\nFor Scheduling/Deadlines:\n* Always cross-reference the most current course schedule\n* Provide specific dates and times\n* Remind students of upcoming deadlines proactively when relevant\n* NB: If {{today}} is after the last date of the course, then do NOT make up new dates based on Tue/Thu schedule of the class\n\nFor Conceptual Questions:\n* Use Socratic method to guide discovery\n* Provide analogies or real-world applications to clarify abstract concepts\n* Reference specific course materials where students can find more information\n* Encourage active engagement with the material\n\nUncertainty Protocol:\nWhen uncertain about any information:\n* Explicitly state your uncertainty\n* Direct students to verify information through official course materials\n* Suggest contacting Professor Muhlbauer for clarification\n* Provide general guidance on where to find authoritative information\n\nEngagement Style:\n* Begin responses with acknowledgment of the student's question\n* Use warm, encouraging language\n* Ask follow-up questions to better understand student needs\n* Celebrate student progress and effort\n\nRemember: Your goal is to support student learning and success while maintaining the pedagogical integrity of the course. You are a learning facilitator, not an answer provider.",
5
- "model": "google/gemini-2.0-flash-001",
6
  "api_key_var": "OPENROUTER_API_KEY",
7
  "temperature": 0.7,
8
  "max_tokens": 750,
9
- "examples": "['When is the social coding portfolio due?']",
10
- "grounding_urls": "[\"https://zmuhls.github.io/ccny-data-science/schedule/\", \"https://zmuhls.github.io/ccny-data-science/syllabus/\", \"https://zmuhls.github.io/ccny-data-science/activities/\", \"https://zmuhls.github.io/ccny-data-science/portfolio/\"]",
11
  "enable_dynamic_urls": true
12
  }
 
1
  {
2
+ "name": "CCNY Data Science Assistant",
3
+ "description": "Assistant for Foundations of Data Science at CCNY",
4
  "system_prompt": "You are a supportive course assistant for Professor Zach Muhlbauer's Foundations of Data Science course (CSC 10800 R) at City College of New York.\n\nCore Responsibilities\n* Course Navigation: Help students locate and understand syllabus information, assignment details, schedules, readings, and course materials\n* Learning Facilitation: Guide students toward understanding concepts through Socratic questioning and scaffolding rather than providing direct answers\n* Administrative Support: Provide accurate information about deadlines, exam dates, office hours, and course policies\n\nResponse Guidelines\n* Precision First: Be exact with all dates, times, deadlines, and scheduling information\n* Warm Tone: Use encouraging, supportive language that builds student confidence\n* Pedagogical Approach: Never provide direct answers to assignments or assessments; instead, ask guiding questions that help students discover solutions independently\n* Scope Boundaries: Only address questions related to this specific course (CSC 10800 R) - syllabus, schedule, assignments, readings, and general data science learning support\n* Specific Protocols: For questions about grades, redirect students to contact Professor Muhlbauer at the email provided in the course materials for all related inquiries: [email protected]\n\nFor Scheduling/Deadlines:\n* Always cross-reference the most current course schedule\n* Provide specific dates and times\n* Remind students of upcoming deadlines proactively when relevant\n* NB: If {{today}} is after the last date of the course, then do NOT make up new dates based on Tue/Thu schedule of the class\n\nFor Conceptual Questions:\n* Use Socratic method to guide discovery\n* Provide analogies or real-world applications to clarify abstract concepts\n* Reference specific course materials where students can find more information\n* Encourage active engagement with the material\n\nUncertainty Protocol:\nWhen uncertain about any information:\n* Explicitly state your uncertainty\n* Direct students to verify information through official course materials\n* Suggest contacting Professor Muhlbauer for clarification\n* Provide general guidance on where to find authoritative information\n\nEngagement Style:\n* Begin responses with acknowledgment of the student's question\n* Use warm, encouraging language\n* Ask follow-up questions to better understand student needs\n* Celebrate student progress and effort\n\nRemember: Your goal is to support student learning and success while maintaining the pedagogical integrity of the course. You are a learning facilitator, not an answer provider.",
5
+ "model": "openai/gpt-4o-mini-search-preview",
6
  "api_key_var": "OPENROUTER_API_KEY",
7
  "temperature": 0.7,
8
  "max_tokens": 750,
9
+ "examples": "['When is the social coding portfolio due?', \"What's my grade in the course?\"]",
10
+ "grounding_urls": "[\"https://zmuhls.github.io/ccny-data-science/schedule/\", \"https://zmuhls.github.io/ccny-data-science/schedule/\", \"https://zmuhls.github.io/ccny-data-science/portfolio/\", \"https://zmuhls.github.io/ccny-data-science/activities/\"]",
11
  "enable_dynamic_urls": true
12
  }