Enhance CHAT_STORAGE_DESIGN.md with locale support and assistant details

- Added `locale` query parameter for assistant information retrieval, allowing for localization based on user preferences.
- Introduced `assistants` field in the response to provide localized details (name, avatar, description) for unique assistant IDs, improving frontend display capabilities.
- Updated documentation to clarify locale resolution priority and the significance of the new `assistants` field in chat responses.
This commit is contained in:
Max 2025-12-10 12:25:27 +08:00
parent 24ad563070
commit 6fef453d46

View file

@ -1673,6 +1673,11 @@ GET /v1/chat/sessions/chat_123/messages?limit=100&offset=0&role=assistant&type=t
| `type` | string | - | Filter by message type |
| `limit` | int | 100 | Max messages to return (max 1000) |
| `offset` | int | 0 | Offset for pagination |
| `locale` | string | - | Locale for assistant info (e.g., `zh-cn`, `en-us`). Falls back to `Accept-Language` header |
**Locale Resolution Priority:**
1. Query parameter `locale`
2. HTTP header `Accept-Language`
**Response:**
@ -1708,10 +1713,20 @@ GET /v1/chat/sessions/chat_123/messages?limit=100&offset=0&role=assistant&type=t
"created_at": "2024-01-15T10:00:05Z"
}
],
"count": 2
"count": 2,
"assistants": {
"weather_assistant": {
"assistant_id": "weather_assistant",
"name": "Weather Assistant",
"avatar": "https://example.com/weather-avatar.png",
"description": "Get weather information for any location"
}
}
}
```
**Note:** The `assistants` field contains localized assistant information (name, avatar, description) for all unique `assistant_id` values found in the messages. This allows the frontend to display assistant details without additional API calls. The locale is determined by the `locale` query parameter or `Accept-Language` header.
### Permission Filtering
All endpoints respect Yao's permission system: