feat(ai): add personal summary models and retire Q&A
Add an admin-managed provider model catalog with per-user summary selection, migration backfill, and generation snapshots. Retire report creation and messaging while preserving owner-scoped history. Refs #15 #16 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -4,8 +4,7 @@ export interface AIProvider {
|
||||
id: string; name: string; model: string; endpoint: string
|
||||
is_active: boolean; has_key: boolean
|
||||
}
|
||||
export interface AIRoleConfig { provider_id: string; model: string }
|
||||
export interface AIRoles { summary: AIRoleConfig; report: AIRoleConfig; filter: AIRoleConfig }
|
||||
export interface AIModelCatalogEntry { id: string; provider_id: string; provider?: string; model: string; enabled: boolean }
|
||||
export interface OllamaModelInfo {
|
||||
name: string; size: number; modified_at: string
|
||||
details: { parameter_size: string; quantization_level: string; family: string }
|
||||
@ -31,15 +30,16 @@ export const adminApi = {
|
||||
api.post<AIProvider>('/admin/ai-providers', data),
|
||||
updateProvider: (id: string, data: { name: string; api_key?: string; model?: string; endpoint?: string }) =>
|
||||
api.put<void>(`/admin/ai-providers/${id}`, data),
|
||||
activateProvider: (id: string) => api.post<void>(`/admin/ai-providers/${id}/activate`),
|
||||
deleteProvider: (id: string) => api.delete<void>(`/admin/ai-providers/${id}`),
|
||||
listModels: (id: string) => api.get<string[]>(`/admin/ai-providers/${id}/models`),
|
||||
probeModels: (data: { name: string; api_key?: string; endpoint?: string }) =>
|
||||
api.post<string[]>('/admin/ai-providers/probe-models', data),
|
||||
|
||||
// AI Roles
|
||||
getRoles: () => api.get<AIRoles>('/admin/ai-roles'),
|
||||
updateRole: (role: string, data: AIRoleConfig) => api.put<void>(`/admin/ai-roles/${role}`, data),
|
||||
// User-selectable synthesis model catalogue
|
||||
listAIModelCatalog: () => api.get<AIModelCatalogEntry[]>('/admin/ai-models'),
|
||||
createAIModelCatalogEntry: (data: { provider_id: string; model: string }) => api.post<AIModelCatalogEntry>('/admin/ai-models', data),
|
||||
updateAIModelCatalogEntry: (id: string, data: { enabled: boolean }) => api.put<AIModelCatalogEntry>(`/admin/ai-models/${encodeURIComponent(id)}`, data),
|
||||
deleteAIModelCatalogEntry: (id: string) => api.delete<void>(`/admin/ai-models/${encodeURIComponent(id)}`),
|
||||
|
||||
// Ollama model management
|
||||
listOllamaModels: () => api.get<OllamaModelInfo[]>('/admin/ollama/models'),
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
import { api } from './client'
|
||||
|
||||
export interface SummaryModelOption { id: string; provider: string; model: string; label?: string }
|
||||
|
||||
export interface UserPreferences {
|
||||
summary_model_id?: string | null
|
||||
language: 'fr' | 'en'
|
||||
ranking_mode: 'title' | 'title_content'
|
||||
}
|
||||
|
||||
export const preferencesApi = {
|
||||
listSummaryModels: () => api.get<SummaryModelOption[]>('/me/summary-models'),
|
||||
get: () => api.get<UserPreferences>('/me/preferences'),
|
||||
update: (preferences: UserPreferences) => api.put<UserPreferences>('/me/preferences', preferences),
|
||||
}
|
||||
|
||||
@ -23,10 +23,6 @@ export interface ReportMessage {
|
||||
|
||||
export const reportsApi = {
|
||||
list: () => api.get<Report[]>('/reports'),
|
||||
create: (data: { summary_id?: string; excerpts: string[]; question: string }) =>
|
||||
api.post<Report>('/reports', data),
|
||||
delete: (id: string) => api.delete<void>(`/reports/${id}`),
|
||||
listMessages: (reportId: string) => api.get<ReportMessage[]>(`/reports/${reportId}/messages`),
|
||||
createMessage: (reportId: string, content: string) =>
|
||||
api.post<ReportMessage>(`/reports/${reportId}/messages`, { content }),
|
||||
}
|
||||
|
||||
@ -6,6 +6,8 @@ export interface Summary {
|
||||
user_id: string
|
||||
content: string
|
||||
ai_provider_id: string | null
|
||||
provider_name?: string | null
|
||||
model_name?: string | null
|
||||
generated_at: string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user