feat: prompt IA dédié AAP avec classification par secteur (Handicap/PA/Enfance/Précarité/Sanitaire)
This commit is contained in:
@@ -23,7 +23,7 @@ import {
|
||||
type RssFeed,
|
||||
} from "../drizzle/schema";
|
||||
import { eq, sql } from "drizzle-orm";
|
||||
import { classifyArticle, generateSummary } from "./aiClassifier";
|
||||
import { classifyArticle, classifyAap, generateSummary } from "./aiClassifier";
|
||||
import { fetchArticleFirstParagraph } from "./articleFetcher";
|
||||
|
||||
// ─── Types internes ───────────────────────────────────────────────────────────
|
||||
@@ -630,16 +630,13 @@ async function processFeed(feed: RssFeed): Promise<FetchResult> {
|
||||
? await fetchArticleFirstParagraph(link)
|
||||
: null;
|
||||
|
||||
const aiResult = await classifyArticle(
|
||||
const aiResult = await classifyAap(
|
||||
title,
|
||||
description,
|
||||
() => ({
|
||||
typeVeille: "informationnelle" as const,
|
||||
}),
|
||||
(feed.defaultCategorieAap ?? "Autre") as "Handicap" | "PA" | "Enfance" | "Précarité" | "Sanitaire" | "Autre",
|
||||
contenuPageAap
|
||||
);
|
||||
|
||||
const categorie = (feed.defaultCategorieAap ?? "Autre") as
|
||||
const categorie = (aiResult.categorieAap ?? feed.defaultCategorieAap ?? "Autre") as
|
||||
"Handicap" | "PA" | "Enfance" | "Précarité" | "Sanitaire" | "Autre";
|
||||
|
||||
// ── Filtre de pertinence : ne pas insérer les AAP non pertinents ─────────
|
||||
|
||||
Reference in New Issue
Block a user