Implement dual-model filing pipeline with Ollama extraction
This commit is contained in:
15
lib/server/api/filing-redaction.ts
Normal file
15
lib/server/api/filing-redaction.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { Filing } from '@/lib/types';
|
||||
|
||||
export function redactInternalFilingAnalysisFields(filing: Filing): Filing {
|
||||
if (!filing.analysis) {
|
||||
return filing;
|
||||
}
|
||||
|
||||
const { extraction: _extraction, extractionMeta: _extractionMeta, ...analysis } = filing.analysis;
|
||||
const hasPublicFields = Object.keys(analysis).length > 0;
|
||||
|
||||
return {
|
||||
...filing,
|
||||
analysis: hasPublicFields ? analysis : null
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user