Skip to content

Commit cec347c

Browse files
committed
feat(store): ManagedStoreInterface added
1 parent 3a160d5 commit cec347c

File tree

38 files changed

+706
-339
lines changed

38 files changed

+706
-339
lines changed

examples/.env

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,29 +84,29 @@ ALBERT_API_URL=
8484
MARIADB_URI=pdo-mysql://root@127.0.0.1:3309/my_database
8585

8686
# Meilisearch
87-
MEILISEARCH_HOST=http://127.0.0.1:7700
87+
MEILISEARCH_ENDPOINT_URL=http://127.0.0.1:7700
8888
MEILISEARCH_API_KEY=changeMe
8989

9090
# For using LMStudio
9191
LMSTUDIO_HOST_URL=http://127.0.0.1:1234
9292

9393
# Qdrant
94-
QDRANT_HOST=http://127.0.0.1:6333
94+
QDRANT_ENDPOINT_URL=http://127.0.0.1:6333
9595
QDRANT_SERVICE_API_KEY=changeMe
9696

9797
# SurrealDB
98-
SURREALDB_HOST=http://127.0.0.1:8000
98+
SURREALDB_ENDPOINT_URL=http://127.0.0.1:8000
9999
SURREALDB_USER=symfony
100100
SURREALDB_PASS=symfony
101101

102102
# Neo4J
103-
NEO4J_HOST=http://127.0.0.1:7474
103+
NEO4J_ENDPOINT_URL=http://127.0.0.1:7474
104104
NEO4J_DATABASE=neo4j
105105
NEO4J_USERNAME=neo4j
106106
NEO4J_PASSWORD=symfonyai
107107

108108
# Typesense
109-
TYPESENSE_HOST=http://127.0.0.1:8108
109+
TYPESENSE_ENDPOINT_URL=http://127.0.0.1:8108
110110
TYPESENSE_API_KEY=changeMe
111111

112112
# Cerebras

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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@
3232
// initialize the store
3333
$store = new Store(
3434
httpClient: HttpClient::create(),
35-
endpointUrl: env('MEILISEARCH_HOST'),
35+
endpointUrl: env('MEILISEARCH_ENDPOINT_URL'),
3636
apiKey: env('MEILISEARCH_API_KEY'),
3737
indexName: 'movies',
3838
);
3939

40+
// initialize the index
41+
$store->setup();
42+
4043
// create embeddings and documents
4144
$documents = [];
4245
foreach (Movies::all() as $i => $movie) {
@@ -47,9 +50,6 @@
4750
);
4851
}
4952

50-
// initialize the index
51-
$store->initialize();
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,6 +38,9 @@
3838
vectorFieldName: 'vector',
3939
);
4040

41+
// initialize the index
42+
$store->setup();
43+
4144
// create embeddings and documents
4245
foreach (Movies::all() as $movie) {
4346
$documents[] = new TextDocument(
@@ -53,9 +56,6 @@
5356
$indexer = new Indexer($vectorizer, $store, logger());
5457
$indexer->index($documents);
5558

56-
// initialize the index
57-
$store->initialize();
58-
5959
$model = new Gpt(Gpt::GPT_4O_MINI);
6060

6161
$similaritySearch = new SimilaritySearch($platform, $embeddings, $store);

examples/rag/neo4j.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// initialize the store
3333
$store = new Store(
3434
httpClient: HttpClient::create(),
35-
endpointUrl: env('NEO4J_HOST'),
35+
endpointUrl: env('NEO4J_ENDPOINT_URL'),
3636
username: env('NEO4J_USERNAME'),
3737
password: env('NEO4J_PASSWORD'),
3838
databaseName: env('NEO4J_DATABASE'),
@@ -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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
tableName: 'my_table',
3737
);
3838

39+
// initialize the table
40+
$store->setup();
41+
3942
// create embeddings and documents
4043
$documents = [];
4144
foreach (Movies::all() as $i => $movie) {
@@ -46,9 +49,6 @@
4649
);
4750
}
4851

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

examples/rag/qdrant.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
// initialize the store
3333
$store = new Store(
3434
HttpClient::create(),
35-
env('QDRANT_HOST'),
35+
env('QDRANT_ENDPOINT_URL'),
3636
env('QDRANT_SERVICE_API_KEY'),
3737
'movies',
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// initialize the store
3333
$store = new Store(
3434
httpClient: HttpClient::create(),
35-
endpointUrl: env('SURREALDB_HOST'),
35+
endpointUrl: env('SURREALDB_ENDPOINT_URL'),
3636
user: env('SURREALDB_USER'),
3737
password: env('SURREALDB_PASS'),
3838
namespace: 'default',
@@ -41,7 +41,7 @@
4141
);
4242

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

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

0 commit comments

Comments
 (0)