Spaces:
Running
Running
Upload 4 files
Browse files- README.md +5 -5
- app.py +15 -23
- config.json +16 -17
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: 💬
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
|
@@ -8,12 +8,12 @@ sdk_version: 5.39.0
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
-
short_description:
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
## Quick Setup
|
| 19 |
|
|
@@ -42,7 +42,7 @@ Interactive STEM adventure games
|
|
| 42 |
Your Space should now be running! Try the example prompts or ask your own questions.
|
| 43 |
|
| 44 |
## Configuration
|
| 45 |
-
- **Model**:
|
| 46 |
- **API Key Variable**: API_KEY
|
| 47 |
- **HF Token Variable**: HF_TOKEN (for auto-updates)
|
| 48 |
- **Access Control**: Enabled (ACCESS_CODE)
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Socratic Dialogue Partner
|
| 3 |
emoji: 💬
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
+
short_description: Socratic dialogue partner based on Phaedrus
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# Socratic Dialogue Partner
|
| 15 |
|
| 16 |
+
Socratic dialogue partner based on Phaedrus
|
| 17 |
|
| 18 |
## Quick Setup
|
| 19 |
|
|
|
|
| 42 |
Your Space should now be running! Try the example prompts or ask your own questions.
|
| 43 |
|
| 44 |
## Configuration
|
| 45 |
+
- **Model**: qwen/qwen3-30b-a3b-instruct-2507
|
| 46 |
- **API Key Variable**: API_KEY
|
| 47 |
- **HF Token Variable**: HF_TOKEN (for auto-updates)
|
| 48 |
- **Access Control**: Enabled (ACCESS_CODE)
|
app.py
CHANGED
|
@@ -12,23 +12,23 @@ from typing import List, Dict, Optional, Any, Tuple
|
|
| 12 |
|
| 13 |
|
| 14 |
# Configuration
|
| 15 |
-
SPACE_NAME = '
|
| 16 |
-
SPACE_DESCRIPTION = '
|
| 17 |
|
| 18 |
# Default configuration values
|
| 19 |
DEFAULT_CONFIG = {
|
| 20 |
'name': SPACE_NAME,
|
| 21 |
'description': SPACE_DESCRIPTION,
|
| 22 |
-
'system_prompt': "
|
| 23 |
-
'temperature': 0.
|
| 24 |
-
'max_tokens':
|
| 25 |
-
'model': '
|
| 26 |
'api_key_var': 'API_KEY',
|
| 27 |
-
'theme': '
|
| 28 |
-
'grounding_urls': ["https://
|
| 29 |
'enable_dynamic_urls': True,
|
| 30 |
'enable_file_upload': True,
|
| 31 |
-
'examples': ['
|
| 32 |
'locked': False
|
| 33 |
}
|
| 34 |
|
|
@@ -691,20 +691,12 @@ def create_interface():
|
|
| 691 |
gr.Markdown(f"ℹ️ {HF_ACCESS_MESSAGE}")
|
| 692 |
gr.Markdown("Set HF_TOKEN in Space secrets to enable auto-save.")
|
| 693 |
|
| 694 |
-
# Current configuration display
|
| 695 |
-
with gr.Accordion("Current Configuration", open=False):
|
| 696 |
-
current_config_display = gr.JSON(
|
| 697 |
-
value=config,
|
| 698 |
-
label="Current Configuration",
|
| 699 |
-
show_label=True
|
| 700 |
-
)
|
| 701 |
-
|
| 702 |
# Configuration editor
|
| 703 |
gr.Markdown("### ⚙️ Configuration Editor")
|
| 704 |
|
| 705 |
# Show lock status if locked
|
| 706 |
if config.get('locked', False):
|
| 707 |
-
gr.Markdown("⚠️ **Note:** Configuration is locked.
|
| 708 |
|
| 709 |
# Basic settings
|
| 710 |
with gr.Column():
|
|
@@ -717,13 +709,13 @@ def create_interface():
|
|
| 717 |
label="Model",
|
| 718 |
choices=[
|
| 719 |
"google/gemini-2.0-flash-001",
|
|
|
|
|
|
|
| 720 |
"anthropic/claude-3.5-haiku",
|
| 721 |
-
"openai/gpt-4o-mini",
|
| 722 |
"openai/gpt-4o-mini-search-preview",
|
| 723 |
-
"
|
| 724 |
-
"
|
| 725 |
-
"
|
| 726 |
-
"custom"
|
| 727 |
],
|
| 728 |
value=config.get('model', ''),
|
| 729 |
allow_custom_value=True
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
# Configuration
|
| 15 |
+
SPACE_NAME = 'Socratic Dialogue Partner'
|
| 16 |
+
SPACE_DESCRIPTION = 'Socratic dialogue partner based on Phaedrus'
|
| 17 |
|
| 18 |
# Default configuration values
|
| 19 |
DEFAULT_CONFIG = {
|
| 20 |
'name': SPACE_NAME,
|
| 21 |
'description': SPACE_DESCRIPTION,
|
| 22 |
+
'system_prompt': "You are a Socratic conversation partner for students in general education courses across all disciplines with strengths in the pebble-in-the-pond learning model, responsive teaching, and constructivist learning principles. Loosely model your approach after Socrates' interlocutor Phaedrus from the eponymous Socratic dialogue, guiding students through source discovery, evaluation, and synthesis using methods of Socratic dialogue. Ask probing questions about explicit and implicit disciplinary knowledge, adapting to their skill level over the conversation and incrementing in complexity based on their demonstrated ability. Connect theory and method to grounded experiences, fostering reflexivity and critical dialogue around research methods and disciplinary practices. Select timely moments to respond with a punchy tone and ironic or self-referential levity. Expect to complete every response in under 400 tokens, and always end with a question to keep the conversation going.",
|
| 23 |
+
'temperature': 0.8,
|
| 24 |
+
'max_tokens': 400,
|
| 25 |
+
'model': 'qwen/qwen3-30b-a3b-instruct-2507',
|
| 26 |
'api_key_var': 'API_KEY',
|
| 27 |
+
'theme': 'Monochrome',
|
| 28 |
+
'grounding_urls': ["https://classics.mit.edu/Plato/phaedrus.1b.txt", "https://plato.stanford.edu/entries/plato-rhetoric/#Pha", "https://plato.stanford.edu/entries/plato-myths/", "https://en.wikipedia.org/wiki/Socratic_method"],
|
| 29 |
'enable_dynamic_urls': True,
|
| 30 |
'enable_file_upload': True,
|
| 31 |
+
'examples': ['What makes a good research question?', 'How do I know if my sources are reliable?', 'Help me think through my thesis argument', "I'm confused about methodology - where do I start?", 'Why does theory matter in practice?'],
|
| 32 |
'locked': False
|
| 33 |
}
|
| 34 |
|
|
|
|
| 691 |
gr.Markdown(f"ℹ️ {HF_ACCESS_MESSAGE}")
|
| 692 |
gr.Markdown("Set HF_TOKEN in Space secrets to enable auto-save.")
|
| 693 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 694 |
# Configuration editor
|
| 695 |
gr.Markdown("### ⚙️ Configuration Editor")
|
| 696 |
|
| 697 |
# Show lock status if locked
|
| 698 |
if config.get('locked', False):
|
| 699 |
+
gr.Markdown("⚠️ **Note:** Configuration is locked.")
|
| 700 |
|
| 701 |
# Basic settings
|
| 702 |
with gr.Column():
|
|
|
|
| 709 |
label="Model",
|
| 710 |
choices=[
|
| 711 |
"google/gemini-2.0-flash-001",
|
| 712 |
+
"google/gemma-3-27b-it",
|
| 713 |
+
"anthropic/claude-3.5-sonnet",
|
| 714 |
"anthropic/claude-3.5-haiku",
|
|
|
|
| 715 |
"openai/gpt-4o-mini-search-preview",
|
| 716 |
+
"openai/gpt-4.1-nano",
|
| 717 |
+
"nvidia/llama-3.1-nemotron-70b-instruct",
|
| 718 |
+
"qwen/qwen3-30b-a3b-instruct-2507"
|
|
|
|
| 719 |
],
|
| 720 |
value=config.get('model', ''),
|
| 721 |
allow_custom_value=True
|
config.json
CHANGED
|
@@ -1,26 +1,25 @@
|
|
| 1 |
{
|
| 2 |
-
"name": "
|
| 3 |
-
"description": "
|
| 4 |
-
"system_prompt": "
|
| 5 |
-
"model": "
|
| 6 |
"api_key_var": "API_KEY",
|
| 7 |
-
"temperature": 0.
|
| 8 |
-
"max_tokens":
|
| 9 |
"examples": [
|
| 10 |
-
"
|
| 11 |
-
"How do I
|
| 12 |
-
"
|
|
|
|
|
|
|
| 13 |
],
|
| 14 |
"grounding_urls": [
|
| 15 |
-
"https://
|
| 16 |
-
"https://
|
| 17 |
-
"https://
|
| 18 |
-
"https://en.wikipedia.org/wiki/
|
| 19 |
-
"https://en.wikipedia.org/wiki/List_of_experiments#Chemistry",
|
| 20 |
-
"https://en.wikipedia.org/wiki/List_of_experiments#Physics",
|
| 21 |
-
"https://en.wikipedia.org/wiki/List_of_experiments#Geology"
|
| 22 |
],
|
| 23 |
"enable_dynamic_urls": true,
|
| 24 |
"enable_file_upload": true,
|
| 25 |
-
"theme": "
|
| 26 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"name": "Socratic Dialogue Partner",
|
| 3 |
+
"description": "Socratic dialogue partner based on Phaedrus",
|
| 4 |
+
"system_prompt": "You are a Socratic conversation partner for students in general education courses across all disciplines with strengths in the pebble-in-the-pond learning model, responsive teaching, and constructivist learning principles. Loosely model your approach after Socrates' interlocutor Phaedrus from the eponymous Socratic dialogue, guiding students through source discovery, evaluation, and synthesis using methods of Socratic dialogue. Ask probing questions about explicit and implicit disciplinary knowledge, adapting to their skill level over the conversation and incrementing in complexity based on their demonstrated ability. Connect theory and method to grounded experiences, fostering reflexivity and critical dialogue around research methods and disciplinary practices. Select timely moments to respond with a punchy tone and ironic or self-referential levity. Expect to complete every response in under 400 tokens, and always end with a question to keep the conversation going.",
|
| 5 |
+
"model": "qwen/qwen3-30b-a3b-instruct-2507",
|
| 6 |
"api_key_var": "API_KEY",
|
| 7 |
+
"temperature": 0.8,
|
| 8 |
+
"max_tokens": 400,
|
| 9 |
"examples": [
|
| 10 |
+
"What makes a good research question?",
|
| 11 |
+
"How do I know if my sources are reliable?",
|
| 12 |
+
"Help me think through my thesis argument",
|
| 13 |
+
"I'm confused about methodology - where do I start?",
|
| 14 |
+
"Why does theory matter in practice?"
|
| 15 |
],
|
| 16 |
"grounding_urls": [
|
| 17 |
+
"https://classics.mit.edu/Plato/phaedrus.1b.txt",
|
| 18 |
+
"https://plato.stanford.edu/entries/plato-rhetoric/#Pha",
|
| 19 |
+
"https://plato.stanford.edu/entries/plato-myths/",
|
| 20 |
+
"https://en.wikipedia.org/wiki/Socratic_method"
|
|
|
|
|
|
|
|
|
|
| 21 |
],
|
| 22 |
"enable_dynamic_urls": true,
|
| 23 |
"enable_file_upload": true,
|
| 24 |
+
"theme": "Monochrome"
|
| 25 |
}
|