Skip to content

Commit a8e826e

Browse files
committed
ref
1 parent 0627dc3 commit a8e826e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

examples/rag/meilisearch.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
indexName: 'movies',
3838
);
3939

40-
// initialize the index
41-
$store->setup();
42-
4340
// create embeddings and documents
4441
$documents = [];
4542
foreach (Movies::all() as $i => $movie) {
@@ -50,6 +47,9 @@
5047
);
5148
}
5249

50+
// initialize the index
51+
$store->setup();
52+
5353
// create embeddings for documents
5454
$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
5555
$vectorizer = new Vectorizer($platform, $embeddings = new Embeddings());

examples/rag/mongodb.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
vectorFieldName: 'vector',
3939
);
4040

41-
// initialize the index
42-
$store->setup();
43-
4441
// create embeddings and documents
4542
foreach (Movies::all() as $movie) {
4643
$documents[] = new TextDocument(
@@ -50,6 +47,9 @@
5047
);
5148
}
5249

50+
// initialize the index
51+
$store->setup();
52+
5353
// create embeddings for documents
5454
$platform = PlatformFactory::create(env('OPENAI_API_KEY'));
5555
$vectorizer = new Vectorizer($platform, $embeddings = new Embeddings());

examples/rag/postgres.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
tableName: 'my_table',
3737
);
3838

39-
// initialize the table
40-
$store->setup();
41-
4239
// create embeddings and documents
4340
$documents = [];
4441
foreach (Movies::all() as $i => $movie) {
@@ -49,6 +46,9 @@
4946
);
5047
}
5148

49+
// initialize the table
50+
$store->setup();
51+
5252
// create embeddings for documents
5353
$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
5454
$vectorizer = new Vectorizer($platform, $embeddings = new Embeddings());

0 commit comments

Comments
 (0)