Spaces:
Running
Running
Commit ·
22521d3
1
Parent(s): 8ca9924
docs: Fix message IDs in API documentation to show database UUIDs
Browse filesUpdate 06-get-messages.md to show accurate message ID format. Message IDs
are database-generated UUIDs, not client-generated IDs from useChat.
Changes:
- Replace example IDs "msg-1", "msg-2" with realistic UUIDs
- Clarify in Response Fields that IDs are "database-generated UUID"
- Add explanatory note about message ID behavior:
* Client-provided IDs are ignored by server
* Server generates new database UUIDs for all messages
* Database UUIDs must be used for branching/quoting operations
This aligns documentation with actual API behavior as validated by
message-id-consistency.api.spec.ts tests.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
docs/backend-doc/06-get-messages.md
CHANGED
|
@@ -24,7 +24,7 @@ curl -X GET http://localhost:3000/api/conversations/403db363-ee32-4ec9-aae0-2017
|
|
| 24 |
{
|
| 25 |
"messages": [
|
| 26 |
{
|
| 27 |
-
"id": "
|
| 28 |
"conversationId": "403db363-ee32-4ec9-aae0-2017af936d52",
|
| 29 |
"role": "user",
|
| 30 |
"speaker": "student",
|
|
@@ -32,7 +32,7 @@ curl -X GET http://localhost:3000/api/conversations/403db363-ee32-4ec9-aae0-2017
|
|
| 32 |
"timestamp": "2025-01-27T10:30:00Z"
|
| 33 |
},
|
| 34 |
{
|
| 35 |
-
"id": "
|
| 36 |
"conversationId": "403db363-ee32-4ec9-aae0-2017af936d52",
|
| 37 |
"role": "assistant",
|
| 38 |
"speaker": "student",
|
|
@@ -40,7 +40,7 @@ curl -X GET http://localhost:3000/api/conversations/403db363-ee32-4ec9-aae0-2017
|
|
| 40 |
"timestamp": "2025-01-27T10:30:15Z"
|
| 41 |
},
|
| 42 |
{
|
| 43 |
-
"id": "
|
| 44 |
"conversationId": "403db363-ee32-4ec9-aae0-2017af936d52",
|
| 45 |
"role": "user",
|
| 46 |
"speaker": "coach",
|
|
@@ -48,7 +48,7 @@ curl -X GET http://localhost:3000/api/conversations/403db363-ee32-4ec9-aae0-2017
|
|
| 48 |
"timestamp": "2025-01-27T10:31:00Z"
|
| 49 |
},
|
| 50 |
{
|
| 51 |
-
"id": "
|
| 52 |
"conversationId": "403db363-ee32-4ec9-aae0-2017af936d52",
|
| 53 |
"role": "assistant",
|
| 54 |
"speaker": "coach",
|
|
@@ -64,7 +64,7 @@ curl -X GET http://localhost:3000/api/conversations/403db363-ee32-4ec9-aae0-2017
|
|
| 64 |
|
| 65 |
Each message includes:
|
| 66 |
|
| 67 |
-
- `id` (string) - Unique message identifier
|
| 68 |
- `conversationId` (string) - Parent conversation ID
|
| 69 |
- `role` (string) - Message role
|
| 70 |
- `"user"` - Message from teacher
|
|
@@ -79,6 +79,8 @@ Each message includes:
|
|
| 79 |
- `quotedText` (string, optional) - Text being replied to
|
| 80 |
- `quotedMessageId` (string, optional) - ID of quoted message
|
| 81 |
|
|
|
|
|
|
|
| 82 |
## Message Types
|
| 83 |
|
| 84 |
### User Message (to Student)
|
|
|
|
| 24 |
{
|
| 25 |
"messages": [
|
| 26 |
{
|
| 27 |
+
"id": "1ef1e965-2bcd-4494-aeb8-eaf07dee2870",
|
| 28 |
"conversationId": "403db363-ee32-4ec9-aae0-2017af936d52",
|
| 29 |
"role": "user",
|
| 30 |
"speaker": "student",
|
|
|
|
| 32 |
"timestamp": "2025-01-27T10:30:00Z"
|
| 33 |
},
|
| 34 |
{
|
| 35 |
+
"id": "2af2f076-3def-4605-beb9-fbc18f1ef981",
|
| 36 |
"conversationId": "403db363-ee32-4ec9-aae0-2017af936d52",
|
| 37 |
"role": "assistant",
|
| 38 |
"speaker": "student",
|
|
|
|
| 40 |
"timestamp": "2025-01-27T10:30:15Z"
|
| 41 |
},
|
| 42 |
{
|
| 43 |
+
"id": "3bf3a187-4efg-5716-cfca-acd29b2fa092",
|
| 44 |
"conversationId": "403db363-ee32-4ec9-aae0-2017af936d52",
|
| 45 |
"role": "user",
|
| 46 |
"speaker": "coach",
|
|
|
|
| 48 |
"timestamp": "2025-01-27T10:31:00Z"
|
| 49 |
},
|
| 50 |
{
|
| 51 |
+
"id": "4ca4b298-5fab-6827-dadb-bde3ac3fb1a3",
|
| 52 |
"conversationId": "403db363-ee32-4ec9-aae0-2017af936d52",
|
| 53 |
"role": "assistant",
|
| 54 |
"speaker": "coach",
|
|
|
|
| 64 |
|
| 65 |
Each message includes:
|
| 66 |
|
| 67 |
+
- `id` (string) - Unique message identifier (database-generated UUID)
|
| 68 |
- `conversationId` (string) - Parent conversation ID
|
| 69 |
- `role` (string) - Message role
|
| 70 |
- `"user"` - Message from teacher
|
|
|
|
| 79 |
- `quotedText` (string, optional) - Text being replied to
|
| 80 |
- `quotedMessageId` (string, optional) - ID of quoted message
|
| 81 |
|
| 82 |
+
**Note on Message IDs**: Message IDs are database-generated UUIDs in the format `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`. Client-provided IDs (from useChat) are ignored by the server. Always use the database UUID returned in the API response for operations like branching or quoting messages.
|
| 83 |
+
|
| 84 |
## Message Types
|
| 85 |
|
| 86 |
### User Message (to Student)
|