Spaces:
Running
Running
Commit ·
e75f9e3
1
Parent(s): 22521d3
docs: Add documentation for discovering prompt IDs
Browse filesAdd comprehensive documentation explaining how to discover and use
student and coach prompt IDs when creating conversations.
Content:
- Overview of student and coach prompt systems
- GET /api/personalities endpoint for programmatic discovery
- Complete list of 10 student prompts (grade_1-9, coach_direct)
- Complete list of 3 coach prompts (empathetic, balanced, structured)
- Usage examples for creating conversations
- Notes about defaults and special prompt IDs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
docs/backend-doc/11-prompt-ids.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# How to Get Prompt IDs
|
| 2 |
+
|
| 3 |
+
## Summary
|
| 4 |
+
|
| 5 |
+
Learn how to discover available student and coach prompt IDs for creating conversations. The system provides two types of prompts: student prompts (grade-based personalities) and coach prompts (teaching persona styles).
|
| 6 |
+
|
| 7 |
+
## Overview
|
| 8 |
+
|
| 9 |
+
When creating a conversation, you need to specify:
|
| 10 |
+
- **Student Prompt ID**: Determines the student's age, personality, and communication style
|
| 11 |
+
- **Coach Prompt ID**: Determines the coaching style and approach (optional, defaults to "balanced")
|
| 12 |
+
|
| 13 |
+
## Discovering Student Prompt IDs
|
| 14 |
+
|
| 15 |
+
### Via API
|
| 16 |
+
|
| 17 |
+
Use the `/api/personalities` endpoint to programmatically discover available student prompts:
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
curl -X GET http://localhost:3000/api/personalities
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
**Response:**
|
| 24 |
+
```json
|
| 25 |
+
{
|
| 26 |
+
"personalities": [
|
| 27 |
+
{
|
| 28 |
+
"id": "grade_1",
|
| 29 |
+
"name": "小一學生 - 7歲",
|
| 30 |
+
"description": "7歲小一學生,具體思考,句子簡單,尋求認可"
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"id": "grade_2",
|
| 34 |
+
"name": "小二學生 - 8歲",
|
| 35 |
+
"description": "8歲小二學生,開始獨立,簡單比較,同儕意識"
|
| 36 |
+
},
|
| 37 |
+
...
|
| 38 |
+
],
|
| 39 |
+
"total": 10
|
| 40 |
+
}
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
### Available Student Prompt IDs
|
| 44 |
+
|
| 45 |
+
All student prompts are defined in `src/lib/prompts/student-prompts.ts`:
|
| 46 |
+
|
| 47 |
+
| ID | Name | Age | Description |
|
| 48 |
+
|----|------|-----|-------------|
|
| 49 |
+
| `grade_1` | 小一學生 | 7歲 | 具體思考,句子簡單,尋求認可 |
|
| 50 |
+
| `grade_2` | 小二學生 | 8歲 | 開始獨立,簡單比較,同儕意識 |
|
| 51 |
+
| `grade_3` | 小三學生 | 9歲 | 複雜情緒,閱讀學習,組織思考 |
|
| 52 |
+
| `grade_4` | 小四學生 | 10歲 | 社會比較,同儕動態,詞彙豐富 |
|
| 53 |
+
| `grade_5` | 小五學生 | 11歲 | 具體邏輯強,情緒調節,規劃能力 |
|
| 54 |
+
| `grade_6` | 小六學生 | 12歲 | 抽象思考初現,身份探索,前青春期 |
|
| 55 |
+
| `grade_7` | 國一學生 | 13歲 | 情緒強烈,同儕壓力,挑戰權威 |
|
| 56 |
+
| `grade_8` | 國二學生 | 14歲 | 假設思考,測試邊界,社交複雜 |
|
| 57 |
+
| `grade_9` | 國三學生 | 15歲 | 科學推理,未來規劃,會考壓力 |
|
| 58 |
+
| `coach_direct` | 直接諮詢教練 | N/A | 直接與教練對話,無學生模擬 |
|
| 59 |
+
|
| 60 |
+
**Note**: `coach_direct` is a special prompt ID for direct coach consultation without student role-play.
|
| 61 |
+
|
| 62 |
+
## Available Coach Prompt IDs
|
| 63 |
+
|
| 64 |
+
Coach prompts are defined in `src/lib/prompts/coach-prompts.ts`:
|
| 65 |
+
|
| 66 |
+
| ID | Name | Description |
|
| 67 |
+
|----|------|-------------|
|
| 68 |
+
| `empathetic` | 王老師 - 同理心取向 | 著重理解、認可和情感連結。擅長建立信任關係,先同理後建議 |
|
| 69 |
+
| `balanced` | 陳老師 - 平衡取向 | 結合同理心和實際建議。平衡情感支持與具體策略(**默認選項**) |
|
| 70 |
+
| `structured` | 李老師 - 結構取向 | 強調行為管理和清晰界線。提供系統化方法和明確步驟 |
|
| 71 |
+
|
| 72 |
+
**Default**: If not specified, `balanced` is used as the default coach prompt.
|
| 73 |
+
|
| 74 |
+
## Usage Examples
|
| 75 |
+
|
| 76 |
+
### Create Conversation with Grade 1 Student
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
curl -X POST http://localhost:3000/api/conversations/create \
|
| 80 |
+
-u "teacher_wang:cz-2025" \
|
| 81 |
+
-H "Content-Type: application/json" \
|
| 82 |
+
-d '{
|
| 83 |
+
"studentPromptId": "grade_1",
|
| 84 |
+
"coachPromptId": "empathetic"
|
| 85 |
+
}'
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
### Create Direct Coach Consultation
|
| 89 |
+
|
| 90 |
+
```bash
|
| 91 |
+
curl -X POST http://localhost:3000/api/conversations/create \
|
| 92 |
+
-u "teacher_wang:cz-2025" \
|
| 93 |
+
-H "Content-Type: application/json" \
|
| 94 |
+
-d '{
|
| 95 |
+
"studentPromptId": "coach_direct",
|
| 96 |
+
"coachPromptId": "balanced"
|
| 97 |
+
}'
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Create Conversation with Default Coach
|
| 101 |
+
|
| 102 |
+
```bash
|
| 103 |
+
curl -X POST http://localhost:3000/api/conversations/create \
|
| 104 |
+
-u "teacher_wang:cz-2025" \
|
| 105 |
+
-H "Content-Type: application/json" \
|
| 106 |
+
-d '{
|
| 107 |
+
"studentPromptId": "grade_7"
|
| 108 |
+
}'
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
**Note**: When `coachPromptId` is omitted, it defaults to `"balanced"`.
|
| 112 |
+
|
| 113 |
+
## Use Cases
|
| 114 |
+
|
| 115 |
+
1. **List all student options** - Use GET `/api/personalities` to populate a UI dropdown
|
| 116 |
+
2. **Age-appropriate simulation** - Select grade level matching the student you want to practice with
|
| 117 |
+
3. **Direct coach consultation** - Use `coach_direct` when you want advice without student role-play
|
| 118 |
+
4. **Coaching style preference** - Choose coach persona that matches your learning style
|
| 119 |
+
|
| 120 |
+
## Notes
|
| 121 |
+
|
| 122 |
+
- Student prompt IDs are based on Taiwan's educational system (小一 to 國三)
|
| 123 |
+
- Each grade level has developmentally appropriate language and behavior patterns
|
| 124 |
+
- Coach prompts affect the tone and approach of feedback, not the accuracy
|
| 125 |
+
- The `coach_direct` student prompt skips student simulation entirely
|
| 126 |
+
- Prompt templates are stored with conversations, so they persist even if templates are updated
|
| 127 |
+
|
| 128 |
+
## Related Operations
|
| 129 |
+
|
| 130 |
+
- [Create conversation](05-create-conversation.md)
|
| 131 |
+
- [Send message to student](03-send-message-to-student.md)
|
| 132 |
+
- [Send message to coach](04-send-message-to-coach.md)
|
| 133 |
+
|
| 134 |
+
## Reference
|
| 135 |
+
|
| 136 |
+
See source code for details:
|
| 137 |
+
- Student prompts: `src/lib/prompts/student-prompts.ts`
|
| 138 |
+
- Coach prompts: `src/lib/prompts/coach-prompts.ts`
|
| 139 |
+
- Personalities API: `src/app/api/personalities/route.ts`
|