Chat title generation

This commit is contained in:
2026-02-14 21:27:44 -08:00
parent 7ef2825c16
commit 684d441763
4 changed files with 144 additions and 0 deletions

View File

@@ -41,6 +41,25 @@ Content type:
- Body: `{ "title"?: string }`
- Response: `{ "chat": ChatSummary }`
### `PATCH /v1/chats/:chatId`
- Body: `{ "title": string }`
- Response: `{ "chat": ChatSummary }`
- Not found: `404 { "message": "chat not found" }`
### `POST /v1/chats/title/suggest`
- Body:
```json
{
"chatId": "chat-id",
"content": "user request text"
}
```
- Response: `{ "chat": ChatSummary }`
Behavior notes:
- If the chat already has a non-empty title, server returns the existing chat unchanged.
- Server always uses OpenAI `gpt-4.1-mini` to generate a one-line title (up to ~4 words), updates the chat title, and returns the updated chat.
### `DELETE /v1/chats/:chatId`
- Response: `{ "deleted": true }`
- Not found: `404 { "message": "chat not found" }`