feat: inject local standards database context into main certificate analysis prompt

This commit is contained in:
2026-06-23 19:51:32 +00:00
parent fef134186a
commit ac695c9d14
2 changed files with 101 additions and 181 deletions
+16 -1
View File
@@ -146,12 +146,27 @@ const App: React.FC = () => {
setError(null);
setReportsData(null);
try {
// Load local standards database
let standardsContext = undefined;
try {
const stdRes = await fetch('/api/standards');
if (stdRes.ok) {
const standards = await stdRes.json();
if (standards && standards.length > 0) {
standardsContext = standards;
}
}
} catch (err) {
console.warn("Could not load local standards database:", err);
}
const data = await analyzeCertificate({
provider,
apiKey,
model,
file,
endpoint: provider === 'ollama' ? endpoint : undefined
endpoint: provider === 'ollama' ? endpoint : undefined,
standardsContext
});
setReportsData(data);
} catch (err) {