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,47 @@
<!-- snippet:syntax-only -->
```dart title="Dart"
import 'dart:convert';
import 'package:kreuzberg/kreuzberg.dart';
Future<void> main() async {
final schema = jsonEncode(<String, Object?>{
'type': 'object',
'properties': <String, Object?>{
'title': <String, Object?>{'type': 'string'},
'authors': <String, Object?>{
'type': 'array',
'items': <String, Object?>{'type': 'string'},
},
'date': <String, Object?>{'type': 'string'},
},
'required': <String>['title', 'authors', 'date'],
'additionalProperties': false,
});
final config = ExtractionConfig(
useCache: true,
enableQualityProcessing: true,
forceOcr: false,
disableOcr: false,
structuredExtraction: StructuredExtractionConfig(
schema: schema,
schemaName: 'paper_metadata',
strict: true,
llm: const LlmConfig(model: 'openai/gpt-4o-mini'),
),
resultFormat: ResultFormat.unified,
outputFormat: OutputFormat.plain(),
includeDocumentStructure: false,
maxArchiveDepth: 3,
useLayoutForMarkdown: false,
);
final result = await KreuzbergBridge.extractFile('paper.pdf', null, config);
final structured = result.structuredOutput;
if (structured != null) {
print(structured);
}
}
```