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,28 @@
```kotlin title="Kotlin"
import dev.kreuzberg.*
class MinLengthValidator(private val minLength: Int) : IValidator {
override fun name(): String = "min-length-validator"
override fun version(): String = "1.0.0"
override fun validate(result: ExtractionResult, config: ExtractionConfig) {
val length = result.content().length
if (length < minLength) {
throw IllegalStateException(
"Content too short: $length < $minLength characters",
)
}
}
override fun should_validate(
_result: ExtractionResult,
_config: ExtractionConfig,
): Boolean = true
override fun priority(): Int = 100
}
fun registerMinLengthValidator() {
ValidatorBridge.registerValidator(MinLengthValidator(minLength = 100))
}
```