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,41 @@
<!-- snippet:syntax-only -->
```csharp title="C#"
using Kreuzberg;
using System.Text.Json;
using System.Text.Json.Nodes;
var schema = JsonNode.Parse("""
{
"type": "object",
"properties": {
"title": { "type": "string" },
"authors": { "type": "array", "items": { "type": "string" } },
"date": { "type": "string" }
},
"required": ["title", "authors", "date"],
"additionalProperties": false
}
""")!;
var config = new ExtractionConfig
{
StructuredExtraction = new StructuredExtractionConfig
{
Schema = schema,
SchemaName = "paper_metadata",
Strict = true,
Llm = new LlmConfig
{
Model = "openai/gpt-4o-mini",
},
},
};
var result = await KreuzbergLib.ExtractFile("paper.pdf", null, config);
if (result.StructuredOutput is not null)
{
Console.WriteLine(JsonSerializer.Serialize(result.StructuredOutput));
}
```