```php title="PHP" getChunks()) { foreach ($result->getChunks() as $index => $chunk) { $embedding = $chunk->getEmbedding(); if ($embedding) { $metadata = [ 'document_id' => $documentId, 'chunk_index' => (string)$index, 'content_length' => (string)strlen($chunk->getContent()), ]; $records[] = new VectorRecord( id: "{$documentId}_chunk_{$index}", content: $chunk->getContent(), embedding: $embedding, metadata: $metadata ); } } } return $records; } // Usage $records = extractAndVectorize('research_paper.pdf', 'doc_123'); foreach ($records as $record) { echo "Vector ID: " . $record->id . "\n"; echo "Content length: " . strlen($record->content) . " characters\n"; echo "Embedding dimension: " . count($record->embedding) . "\n"; echo "---\n"; } ?> ```