mirror of
https://github.com/mudler/LocalAI
synced 2026-05-24 09:28:23 +00:00
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> |
||
|---|---|---|
| .. | ||
| agent_jobs.go | ||
| application.go | ||
| application_suite_test.go | ||
| config_file_watcher.go | ||
| distributed.go | ||
| p2p.go | ||
| runtime_settings_branding_test.go | ||
| startup.go | ||
| upgrade_checker.go | ||
| watchdog.go | ||
| watchdog_test.go | ||