feat(cover-letter): add contextual AI workspace

This commit is contained in:
cesnimda
2026-08-28 12:34:17 +02:00
parent e3f938cb42
commit b6dcc7c760
7 changed files with 346 additions and 21 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ export const COVER_LETTER_MODES = ["professional", "friendly", "short", "detaile
export const aiWorkspaceApi = {
usage: () => api.get<AiUsage>("/ai/usage").then((r) => r.data),
modules: (jobId: number) => api.get<{ modules: string[]; provider: string }>(`/jobapplications/${jobId}/ai/modules`).then((r) => r.data),
generate: (jobId: number, body: { module: string; mode?: string; extraContext?: string }) =>
generate: (jobId: number, body: { module: string; mode?: string; extraContext?: string; targetLanguage?: "en" | "nb-NO"; currentText?: string; action?: string }) =>
api.post<AiInteraction>(`/jobapplications/${jobId}/ai/generate`, body).then((r) => r.data),
history: (jobId: number, module?: string) =>
api.get<AiInteraction[]>(`/jobapplications/${jobId}/ai/history`, { params: { module } }).then((r) => r.data),