Skip to content

Commit 0164be2

Browse files
authored
docs: Streamline examples (#111)
1 parent 1bf42d7 commit 0164be2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/store-mongodb-similarity-search.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@
3939

4040
// our data
4141
$movies = [
42-
['title' => 'Inception', 'description' => 'A skilled thief is given a chance at redemption if he can successfully perform inception, the act of planting an idea in someone\'s subconscious.', 'regisseur' => 'Christopher Nolan'],
43-
['title' => 'The Matrix', 'description' => 'A hacker discovers the world he lives in is a simulated reality and joins a rebellion to overthrow its controllers.', 'regisseur' => 'The Wachowskis'],
44-
['title' => 'The Godfather', 'description' => 'The aging patriarch of an organized crime dynasty transfers control of his empire to his reluctant son.', 'regisseur' => 'Francis Ford Coppola'],
42+
['title' => 'Inception', 'description' => 'A skilled thief is given a chance at redemption if he can successfully perform inception, the act of planting an idea in someone\'s subconscious.', 'director' => 'Christopher Nolan'],
43+
['title' => 'The Matrix', 'description' => 'A hacker discovers the world he lives in is a simulated reality and joins a rebellion to overthrow its controllers.', 'director' => 'The Wachowskis'],
44+
['title' => 'The Godfather', 'description' => 'The aging patriarch of an organized crime dynasty transfers control of his empire to his reluctant son.', 'director' => 'Francis Ford Coppola'],
4545
];
4646

4747
// create embeddings and documents
4848
foreach ($movies as $movie) {
4949
$documents[] = Document::fromText(
5050
id: Uuid::v4(),
51-
text: $movie['title'].' '.$movie['description'],
51+
text: 'Title: '.$movie['title'].PHP_EOL.'Director: '.$movie['director'].PHP_EOL.'Description: '.$movie['description'],
5252
metadata: new Metadata($movie),
5353
);
5454
}

examples/store-pinecone-similarity-search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
foreach ($movies as $movie) {
4343
$documents[] = Document::fromText(
4444
id: Uuid::v4(),
45-
text: 'Title: '.$movie['title'].PHP_EOL.'Director: '.$movie['director'].PHP_EOL.$movie['description'],
45+
text: 'Title: '.$movie['title'].PHP_EOL.'Director: '.$movie['director'].PHP_EOL.'Description: '.$movie['description'],
4646
metadata: new Metadata($movie),
4747
);
4848
}

0 commit comments

Comments
 (0)