This commit is contained in:
14
docs/snippets/java/utils/standalone_embed.md
Normal file
14
docs/snippets/java/utils/standalone_embed.md
Normal file
@@ -0,0 +1,14 @@
|
||||
```java
|
||||
import dev.kreuzberg.Kreuzberg;
|
||||
import dev.kreuzberg.EmbeddingConfig;
|
||||
|
||||
// Embed with default config
|
||||
float[][] embeddings = Kreuzberg.embed(List.of("Hello world", "How are you?"), null);
|
||||
|
||||
// Embed with specific preset
|
||||
EmbeddingConfig config = EmbeddingConfig.withPreset("fast");
|
||||
float[][] fastEmbeddings = Kreuzberg.embed(List.of("Hello world"), config);
|
||||
|
||||
// Async variant
|
||||
CompletableFuture<float[][]> future = Kreuzberg.embedAsync(texts, null);
|
||||
```
|
||||
Reference in New Issue
Block a user