7878use Symfony \AI \Store \Bridge \ChromaDb \Store as ChromaDbStore ;
7979use Symfony \AI \Store \Bridge \ClickHouse \Store as ClickHouseStore ;
8080use Symfony \AI \Store \Bridge \Cloudflare \Store as CloudflareStore ;
81- use Symfony \AI \Store \Bridge \Local \CacheStore ;
81+ use Symfony \AI \Store \Bridge \Local \CacheStore as LocalCacheStore ;
8282use Symfony \AI \Store \Bridge \Local \DistanceCalculator ;
8383use Symfony \AI \Store \Bridge \Local \DistanceStrategy ;
84- use Symfony \AI \Store \Bridge \Local \InMemoryStore ;
84+ use Symfony \AI \Store \Bridge \Local \InMemoryStore as LocalInMemoryStore ;
8585use Symfony \AI \Store \Bridge \Manticore \Store as ManticoreStore ;
8686use Symfony \AI \Store \Bridge \MariaDb \Store as MariaDbStore ;
8787use Symfony \AI \Store \Bridge \Meilisearch \Store as MeilisearchStore ;
@@ -959,7 +959,7 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
959959 $ arguments [1 ] = new Reference ('ai.store.distance_calculator. ' .$ name );
960960 }
961961
962- $ definition = new Definition (CacheStore ::class);
962+ $ definition = new Definition (LocalCacheStore ::class);
963963 $ definition
964964 ->setLazy (true )
965965 ->setArguments ($ arguments )
@@ -997,9 +997,9 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
997997 } else {
998998 $ httpClient = new Definition (HttpClientInterface::class);
999999 $ httpClient
1000+ ->setLazy (true )
10001001 ->setFactory ([HttpClient::class, 'createForBaseUri ' ])
1001- ->setArguments ([$ store ['dsn ' ]])
1002- ;
1002+ ->setArguments ([$ store ['dsn ' ]]);
10031003 }
10041004
10051005 $ definition = new Definition (ClickHouseStore::class);
@@ -1011,8 +1011,7 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
10111011 $ store ['table ' ],
10121012 ])
10131013 ->addTag ('proxy ' , ['interface ' => StoreInterface::class])
1014- ->addTag ('ai.store ' )
1015- ;
1014+ ->addTag ('ai.store ' );
10161015
10171016 $ container ->setDefinition ('ai.store. ' .$ type .'. ' .$ name , $ definition );
10181017 $ container ->registerAliasForArgument ('ai.store. ' .$ type .'. ' .$ name , StoreInterface::class, $ name );
@@ -1027,16 +1026,10 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
10271026 $ store ['account_id ' ],
10281027 $ store ['api_key ' ],
10291028 $ store ['index_name ' ],
1029+ $ store ['dimensions ' ],
1030+ $ store ['metric ' ],
10301031 ];
10311032
1032- if (\array_key_exists ('dimensions ' , $ store )) {
1033- $ arguments [4 ] = $ store ['dimensions ' ];
1034- }
1035-
1036- if (\array_key_exists ('metric ' , $ store )) {
1037- $ arguments [5 ] = $ store ['metric ' ];
1038- }
1039-
10401033 if (\array_key_exists ('endpoint_url ' , $ store )) {
10411034 $ arguments [6 ] = $ store ['endpoint_url ' ];
10421035 }
@@ -1060,34 +1053,22 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
10601053 new Reference ('http_client ' ),
10611054 $ store ['endpoint ' ],
10621055 $ store ['table ' ],
1056+ $ store ['field ' ],
1057+ $ store ['type ' ],
1058+ $ store ['similarity ' ],
1059+ $ store ['dimensions ' ],
10631060 ];
10641061
1065- if (\array_key_exists ('field ' , $ store )) {
1066- $ arguments [3 ] = $ store ['field ' ];
1067- }
1068-
1069- if (\array_key_exists ('type ' , $ store )) {
1070- $ arguments [4 ] = $ store ['type ' ];
1071- }
1072-
1073- if (\array_key_exists ('similarity ' , $ store )) {
1074- $ arguments [5 ] = $ store ['similarity ' ];
1075- }
1076-
1077- if (\array_key_exists ('dimensions ' , $ store )) {
1078- $ arguments [6 ] = $ store ['dimensions ' ];
1079- }
1080-
10811062 if (\array_key_exists ('quantization ' , $ store )) {
10821063 $ arguments [7 ] = $ store ['quantization ' ];
10831064 }
10841065
10851066 $ definition = new Definition (ManticoreStore::class);
10861067 $ definition
10871068 ->setLazy (true )
1088- ->addTag ( ' ai.store ' )
1069+ ->setArguments ( $ arguments )
10891070 ->addTag ('proxy ' , ['interface ' => StoreInterface::class])
1090- ->setArguments ( $ arguments );
1071+ ->addTag ( ' ai.store ' );
10911072
10921073 $ container ->setDefinition ('ai.store. ' .$ type .'. ' .$ name , $ definition );
10931074 $ container ->registerAliasForArgument ('ai.store. ' .$ type .'. ' .$ name , StoreInterface::class, $ name );
@@ -1098,9 +1079,9 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
10981079 if ('mariadb ' === $ type ) {
10991080 foreach ($ stores as $ name => $ store ) {
11001081 $ definition = new Definition (MariaDbStore::class);
1101- $ definition ->setFactory ([MariaDbStore::class, 'fromDbal ' ]);
11021082 $ definition
11031083 ->setLazy (true )
1084+ ->setFactory ([MariaDbStore::class, 'fromDbal ' ])
11041085 ->setArguments ([
11051086 new Reference (\sprintf ('doctrine.dbal.%s_connection ' , $ store ['connection ' ])),
11061087 $ store ['table_name ' ],
@@ -1171,7 +1152,7 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
11711152 $ arguments [0 ] = new Reference ('ai.store.distance_calculator. ' .$ name );
11721153 }
11731154
1174- $ definition = new Definition (InMemoryStore ::class);
1155+ $ definition = new Definition (LocalInMemoryStore ::class);
11751156 $ definition
11761157 ->setLazy (true )
11771158 ->setArguments ($ arguments )
@@ -1621,7 +1602,7 @@ private function processMessageStoreConfig(string $type, array $messageStores, C
16211602
16221603 if ('memory ' === $ type ) {
16231604 foreach ($ messageStores as $ name => $ messageStore ) {
1624- $ definition = new Definition (InMemoryStore ::class);
1605+ $ definition = new Definition (LocalInMemoryStore ::class);
16251606 $ definition
16261607 ->setLazy (true )
16271608 ->setArgument (0 , $ messageStore ['identifier ' ])
0 commit comments