LocalAI/core/application
TLoE419 4634b87c53 feat(api): expose chat conversation CRUD endpoints (#9432)
Wire the chathistory store into the HTTP layer. New endpoints under
/api/conversations:

- GET    /api/conversations        list
- POST   /api/conversations        upsert (id in body)
- DELETE /api/conversations        delete all
- PUT    /api/conversations/bulk   replace entire set (localStorage migration)
- GET    /api/conversations/:id    fetch one
- PUT    /api/conversations/:id    upsert (id in path; path id wins over body)
- DELETE /api/conversations/:id    delete one

All endpoints scope queries to the authenticated user via getUserID(c)
- callers cannot impersonate other users by passing a user_id in the
body. The endpoints are gated behind the new chat_history feature
permission (default ON in APIFeatures), registered through the existing
RouteFeatureRegistry so the unified feature middleware picks them up
automatically.

Application.ChatHistoryStore() returns nil when DisableWebUI is set or
no persistence path is configured, in which case route registration is
skipped entirely rather than registering handlers that always 503.

Also adds the chat-history instruction entry and Swagger tag so the
endpoint surfaces in /api/instructions and /swagger.

Assisted-by: Claude:claude-opus-4-7

Signed-off-by: TLoE419 <tloemizuchizu@gmail.com>
2026-05-18 18:06:06 -07:00
..
agent_jobs.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
application.go feat(api): expose chat conversation CRUD endpoints (#9432) 2026-05-18 18:06:06 -07:00
application_suite_test.go feat(branding): admin-configurable instance name, tagline, and assets (#9635) 2026-05-02 15:51:36 +02:00
config_file_watcher.go feat(ux): backend management enhancement (#9325) 2026-04-12 00:35:22 +02:00
distributed.go fix(distributed): cascade-clean stale node_models rows + filter routing by healthy status (#9754) 2026-05-13 21:57:50 +02:00
p2p.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
runtime_settings_branding_test.go feat(branding): admin-configurable instance name, tagline, and assets (#9635) 2026-05-02 15:51:36 +02:00
startup.go feat(gallery): verify backend OCI images with keyless cosign (#9823) 2026-05-18 08:02:20 +02:00
upgrade_checker.go feat(gallery): verify backend OCI images with keyless cosign (#9823) 2026-05-18 08:02:20 +02:00
watchdog.go feat(concurrency-groups): per-model exclusive groups for backend loading (#9662) 2026-05-05 08:42:50 +02:00
watchdog_test.go feat(concurrency-groups): per-model exclusive groups for backend loading (#9662) 2026-05-05 08:42:50 +02:00