This commit is contained in:
18
docs/snippets/dart/utils/standalone_embed.md
Normal file
18
docs/snippets/dart/utils/standalone_embed.md
Normal file
@@ -0,0 +1,18 @@
|
||||
```dart title="Dart"
|
||||
import 'package:kreuzberg/kreuzberg.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
const config = EmbeddingConfig(
|
||||
model: EmbeddingModelType.preset(name: 'balanced'),
|
||||
normalize: true,
|
||||
batchSize: 32,
|
||||
showDownloadProgress: false,
|
||||
);
|
||||
|
||||
final texts = <String>['Hello, world!', 'Kreuzberg is fast'];
|
||||
final embeddings = await KreuzbergBridge.embedTexts(texts, config);
|
||||
|
||||
print('Vectors: ${embeddings.length}');
|
||||
print('Dimensions: ${embeddings.first.length}');
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user