Skip to content

Commit 631c339

Browse files
committed
feature #328 [Store] Add ManagedStoreInterface (Guikingone)
This PR was squashed before being merged into the main branch. Discussion ---------- [Store] Add ManagedStoreInterface | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Docs? | yes | Issues | #285 #314 | License | MIT Hi 👋🏻 This PR aim to introduce the `ManagedStoreInterface` as discussed in #285, `Store` is a critical part of this library so I'm not gonna pretend that I know how each store currently work but here's the refactoring for most of them, tests must be improved but here's the first "draft". This PR does not include the related commands. Commits ------- 35aec00 [Store] Add ManagedStoreInterface
2 parents c25af5e + 35aec00 commit 631c339

39 files changed

+812
-358
lines changed

examples/memory/mariadb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
}
5555

5656
// initialize the table
57-
$store->initialize();
57+
$store->setup();
5858

5959
// create embeddings for documents as preparation of the chain memory
6060
$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());

examples/rag/mariadb-gemini.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949

5050
// initialize the table
51-
$store->initialize(['dimensions' => 768]);
51+
$store->setup(['dimensions' => 768]);
5252

5353
// create embeddings for documents
5454
$platform = PlatformFactory::create(env('GEMINI_API_KEY'), http_client());

examples/rag/mariadb-openai.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}
4848

4949
// initialize the table
50-
$store->initialize();
50+
$store->setup();
5151

5252
// create embeddings for documents
5353
$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());

examples/rag/meilisearch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949

5050
// initialize the index
51-
$store->initialize();
51+
$store->setup();
5252

5353
// create embeddings for documents
5454
$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());

examples/rag/mongodb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
$indexer->index($documents);
5555

5656
// initialize the index
57-
$store->initialize();
57+
$store->setup();
5858

5959
$model = new Gpt(Gpt::GPT_4O_MINI);
6060

examples/rag/neo4j.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
);
4242

4343
// initialize the table
44-
$store->initialize();
44+
$store->setup();
4545

4646
// create embeddings and documents
4747
$documents = [];

examples/rag/postgres.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}
4848

4949
// initialize the table
50-
$store->initialize();
50+
$store->setup();
5151

5252
// create embeddings for documents
5353
$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());

examples/rag/qdrant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
);
3939

4040
// initialize the collection (needs to be called before the indexer)
41-
$store->initialize();
41+
$store->setup();
4242

4343
// create embeddings and documents
4444
foreach (Movies::all() as $movie) {

examples/rag/surrealdb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
);
4242

4343
// initialize the table
44-
$store->initialize();
44+
$store->setup();
4545

4646
// create embeddings and documents
4747
$documents = [];

examples/rag/typesense.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
);
3838

3939
// initialize the index
40-
$store->initialize();
40+
$store->setup();
4141

4242
// create embeddings and documents
4343
$documents = [];

0 commit comments

Comments
 (0)