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,22 @@
```kotlin title="Kotlin"
import dev.kreuzberg.*
// Wrap a host-language embedding model so kreuzberg can call back into it
// during chunking and standalone embed requests.
class MyEmbedder(private val dim: Long = 768L) : IEmbeddingBackend {
override fun name(): String = "my-embedder"
override fun version(): String = "1.0.0"
override fun dimensions(): Long = dim
override fun embed(texts: List<String>): List<List<Float>> {
// Replace this with a real model invocation. Each inner list must
// have exactly `dimensions()` elements — the bridge validates shape.
return texts.map { List(dim.toInt()) { 0.0f } }
}
}
fun registerMyEmbedder() {
EmbeddingBackendBridge.registerEmbeddingBackend(MyEmbedder())
}
```