This commit is contained in:
27
docs/snippets/php/config/embedding_config.md
Normal file
27
docs/snippets/php/config/embedding_config.md
Normal file
@@ -0,0 +1,27 @@
|
||||
```php title="PHP"
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Kreuzberg\Kreuzberg;
|
||||
use Kreuzberg\ExtractionConfig;
|
||||
use Kreuzberg\ChunkingConfig;
|
||||
use Kreuzberg\EmbeddingConfig;
|
||||
|
||||
$config = new ExtractionConfig(
|
||||
chunking: new ChunkingConfig(
|
||||
maxCharacters: 1000,
|
||||
overlap: 200,
|
||||
embedding: new EmbeddingConfig(
|
||||
model: 'balanced',
|
||||
batchSize: 16,
|
||||
normalize: true,
|
||||
showDownloadProgress: true
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$result = Kreuzberg::extractFileSync('document.pdf', null, $config);
|
||||
|
||||
echo "Chunks with embeddings: " . count($result->getChunks()) . "\n";
|
||||
?>
|
||||
```
|
||||
Reference in New Issue
Block a user