Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
```csharp title="C#"
using Kreuzberg;
var enricher = new PdfMetadataEnricher();
PostProcessorRegistry.Register(enricher);
public class PdfMetadataEnricher : IPostProcessor
{
private int _processedCount = 0;
public string Name => "pdf-metadata-enricher";
public string Version => "1.0.0";
public void Initialize()
{
Console.WriteLine("PDF metadata enricher initialized");
_processedCount = 0;
}
public void Shutdown()
{
Console.WriteLine($"PDF metadata enricher processed {_processedCount} documents");
}
public void Process(ExtractionResult result, ExtractionConfig config)
{
if (result.MimeType == "application/pdf")
{
_processedCount++;
if (result.Metadata == null)
{
result.Metadata = new Metadata();
}
result.Metadata.Author = result.Metadata.Author ?? "Unknown";
}
}
public ProcessingStage ProcessingStage()
{
return ProcessingStage.Early;
}
public bool ShouldProcess(ExtractionResult result, ExtractionConfig config)
{
return result.MimeType == "application/pdf";
}
public ulong EstimatedDurationMs(ExtractionResult result)
{
return 50;
}
public int Priority()
{
return 50;
}
}
```