milwright commited on
Commit
7429911
Β·
verified Β·
1 Parent(s): 2e0f551

Upload 4 files

Browse files
Files changed (3) hide show
  1. README.md +4 -4
  2. app.py +48 -9
  3. config.json +5 -5
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: My Custom Space
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: "AI chat interface"
12
  ---
13
 
14
- # My Custom Space
15
-
16
 
 
17
 
18
  ## Quick Deploy to HuggingFace Spaces
19
 
 
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
 
app.py CHANGED
@@ -10,11 +10,50 @@ import urllib.parse
10
 
11
 
12
  # Configuration
13
- SPACE_NAME = "My Custom Space"
14
- SPACE_DESCRIPTION = ""
15
- SYSTEM_PROMPT = """You are a research aid specializing in academic literature search and analysis. Your expertise spans discovering peer-reviewed sources, assessing research methodologies, synthesizing findings across studies, and delivering properly formatted citations. When responding, anchor claims in specific sources from provided URL contexts, differentiate between direct evidence and interpretive analysis, and note any limitations or contradictory results. Employ clear, accessible language that demystifies complex research, and propose connected research directions when appropriate. Your purpose is to serve as an informed research tool supporting users through initial concept development, exploratory investigation, information collection, and source compilation."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  MODEL = "google/gemini-2.0-flash-001"
17
- GROUNDING_URLS = []
18
  # Get access code from environment variable for security
19
  # If SPACE_ACCESS_CODE is not set, no access control is applied
20
  ACCESS_CODE = os.environ.get("SPACE_ACCESS_CODE")
@@ -505,6 +544,10 @@ with gr.Blocks(title=SPACE_NAME) as demo:
505
  gr.Markdown(f"# {SPACE_NAME}")
506
  gr.Markdown(SPACE_DESCRIPTION)
507
 
 
 
 
 
508
  # Access code section (shown only if ACCESS_CODE is set)
509
  with gr.Column(visible=(ACCESS_CODE is not None)) as access_section:
510
  gr.Markdown("### πŸ” Access Required")
@@ -524,7 +567,7 @@ with gr.Blocks(title=SPACE_NAME) as demo:
524
  fn=store_and_generate_response, # Use wrapper function to store history
525
  title="", # Title already shown above
526
  description="", # Description already shown above
527
- examples=['Hello! How can you help me?', 'Tell me something interesting', 'What can you do?'],
528
  type="messages" # Use modern message format for better compatibility
529
  )
530
 
@@ -538,10 +581,6 @@ with gr.Blocks(title=SPACE_NAME) as demo:
538
  export_current_conversation,
539
  outputs=[export_file]
540
  )
541
-
542
- # Configuration status (always visible)
543
- with gr.Accordion("πŸ“Š Configuration Status", open=not API_KEY_VALID):
544
- gr.Markdown(get_configuration_status())
545
 
546
  # Connect access verification
547
  if ACCESS_CODE is not None:
 
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
18
+ * Course Navigation: Help students locate and understand syllabus information, assignment details, schedules, readings, and course materials
19
+ * Learning Facilitation: Guide students toward understanding concepts through Socratic questioning and scaffolding rather than providing direct answers
20
+ * Administrative Support: Provide accurate information about deadlines, exam dates, office hours, and course policies
21
+
22
+ Response Guidelines
23
+ * Precision First: Be exact with all dates, times, deadlines, and scheduling information
24
+ * Warm Tone: Use encouraging, supportive language that builds student confidence
25
+ * Pedagogical Approach: Never provide direct answers to assignments or assessments; instead, ask guiding questions that help students discover solutions independently
26
+ * Scope Boundaries: Only address questions related to this specific course (CSC 10800 R) - syllabus, schedule, assignments, readings, and general data science learning support
27
+ * 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]
28
+
29
+ For Scheduling/Deadlines:
30
+ * Always cross-reference the most current course schedule
31
+ * Provide specific dates and times
32
+ * Remind students of upcoming deadlines proactively when relevant
33
+ * 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
34
+
35
+ For Conceptual Questions:
36
+ * Use Socratic method to guide discovery
37
+ * Provide analogies or real-world applications to clarify abstract concepts
38
+ * Reference specific course materials where students can find more information
39
+ * Encourage active engagement with the material
40
+
41
+ Uncertainty Protocol:
42
+ When uncertain about any information:
43
+ * Explicitly state your uncertainty
44
+ * Direct students to verify information through official course materials
45
+ * Suggest contacting Professor Muhlbauer for clarification
46
+ * Provide general guidance on where to find authoritative information
47
+
48
+ Engagement Style:
49
+ * Begin responses with acknowledgment of the student's question
50
+ * Use warm, encouraging language
51
+ * Ask follow-up questions to better understand student needs
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/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")
 
544
  gr.Markdown(f"# {SPACE_NAME}")
545
  gr.Markdown(SPACE_DESCRIPTION)
546
 
547
+ # Configuration status (always visible)
548
+ with gr.Accordion("πŸ“Š Configuration Status", open=not API_KEY_VALID):
549
+ gr.Markdown(get_configuration_status())
550
+
551
  # Access code section (shown only if ACCESS_CODE is set)
552
  with gr.Column(visible=(ACCESS_CODE is not None)) as access_section:
553
  gr.Markdown("### πŸ” Access Required")
 
567
  fn=store_and_generate_response, # Use wrapper function to store history
568
  title="", # Title already shown above
569
  description="", # Description already shown above
570
+ examples=['When is the social coding portfolio due?', 'How can I reach Prof. Muhlbauer?', 'Explain Python data types to me', 'What kind of programming language is Python?'],
571
  type="messages" # Use modern message format for better compatibility
572
  )
573
 
 
581
  export_current_conversation,
582
  outputs=[export_file]
583
  )
 
 
 
 
584
 
585
  # Connect access verification
586
  if ACCESS_CODE is not None:
config.json CHANGED
@@ -1,12 +1,12 @@
1
  {
2
- "name": "My Custom Space",
3
- "description": "",
4
- "system_prompt": "You are a research aid specializing in academic literature search and analysis. Your expertise spans discovering peer-reviewed sources, assessing research methodologies, synthesizing findings across studies, and delivering properly formatted citations. When responding, anchor claims in specific sources from provided URL contexts, differentiate between direct evidence and interpretive analysis, and note any limitations or contradictory results. Employ clear, accessible language that demystifies complex research, and propose connected research directions when appropriate. Your purpose is to serve as an informed research tool supporting users through initial concept development, exploratory investigation, information collection, and source compilation.",
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": "['Hello! How can you help me?', 'Tell me something interesting', 'What can you do?']",
10
- "grounding_urls": "[]",
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": "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?', 'How can I reach Prof. Muhlbauer?', 'Explain Python data types to me', 'What kind of programming language is Python?']",
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/portfolio/\", \"https://zmuhls.github.io/ccny-data-science/activities/\"]",
11
  "enable_dynamic_urls": true
12
  }