Skip to content

Commit 65d9895

Browse files
committed
feature #1056 [AI Bundle] Rename chroma_db config key to chromadb (OskarStark)
This PR was merged into the main branch. Discussion ---------- [AI Bundle] Rename `chroma_db` config key to `chromadb` | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Docs? | no | Issues | -- | License | MIT Commits ------- a0b4439 Rename chroma_db config key to chromadb
2 parents a63b279 + a0b4439 commit 65d9895

File tree

7 files changed

+40
-40
lines changed

7 files changed

+40
-40
lines changed

demo/config/packages/ai.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ai:
8282
technical: ['bug', 'problem', 'technical', 'error', 'code', 'debug']
8383
fallback: 'fallback'
8484
store:
85-
chroma_db:
85+
chromadb:
8686
symfonycon:
8787
collection: 'symfony_blog'
8888
vectorizer:
@@ -99,11 +99,11 @@ ai:
9999
- 'Symfony\AI\Store\Document\Transformer\TextSplitTransformer'
100100
- 'Symfony\AI\Store\Document\Transformer\TextTrimTransformer'
101101
vectorizer: 'ai.vectorizer.openai'
102-
store: 'ai.store.chroma_db.symfonycon'
102+
store: 'ai.store.chromadb.symfonycon'
103103
retriever:
104104
blog:
105105
vectorizer: 'ai.vectorizer.openai'
106-
store: 'ai.store.chroma_db.symfonycon'
106+
store: 'ai.store.chromadb.symfonycon'
107107

108108
services:
109109
_defaults:
@@ -112,7 +112,7 @@ services:
112112

113113
Symfony\AI\Agent\Bridge\SimilaritySearch\SimilaritySearch:
114114
$vectorizer: '@ai.vectorizer.openai'
115-
$store: '@ai.store.chroma_db.symfonycon'
115+
$store: '@ai.store.chromadb.symfonycon'
116116

117117
Symfony\AI\Store\Document\Loader\RssFeedLoader: ~
118118
Symfony\AI\Store\Document\Transformer\TextSplitTransformer: ~

docs/bundles/ai-bundle.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Advanced Example with Multiple Agents
102102
model: 'text-to-speech'
103103
tools: false
104104
store:
105-
chroma_db:
105+
chromadb:
106106
# multiple collections possible per type
107107
default:
108108
collection: 'my_collection'
@@ -129,7 +129,7 @@ Advanced Example with Multiple Agents
129129
default:
130130
loader: 'Symfony\AI\Store\Document\Loader\InMemoryLoader'
131131
vectorizer: 'ai.vectorizer.openai_embeddings'
132-
store: 'ai.store.chroma_db.default'
132+
store: 'ai.store.chromadb.default'
133133
134134
research:
135135
loader: 'Symfony\AI\Store\Document\Loader\TextFileLoader'
@@ -212,15 +212,15 @@ For each configured store, the bundle automatically creates two types of aliases
212212
strategy: 'cosine'
213213
products:
214214
strategy: 'manhattan'
215-
chroma_db:
215+
chromadb:
216216
main:
217217
collection: 'documents'
218218
219219
From the configuration above, the following aliases are automatically registered:
220220

221221
- ``StoreInterface $main`` - References the memory store (first occurrence)
222222
- ``StoreInterface $memoryMain`` - Explicitly references the memory store
223-
- ``StoreInterface $chromaDbMain`` - Explicitly references the chroma_db store
223+
- ``StoreInterface $chromadbMain`` - Explicitly references the chromadb store
224224
- ``StoreInterface $products`` - References the memory products store
225225
- ``StoreInterface $memoryProducts`` - Explicitly references the memory products store
226226

@@ -232,14 +232,14 @@ You can inject stores into your services using the generated aliases::
232232
{
233233
public function __construct(
234234
private StoreInterface $main, // Uses memory store (first occurrence)
235-
private StoreInterface $chromaDbMain, // Explicitly uses chroma_db store
235+
private StoreInterface $chromadbMain, // Explicitly uses chromadb store
236236
private StoreInterface $memoryProducts, // Explicitly uses memory products store
237237
) {
238238
}
239239
}
240240

241241
When multiple stores share the same name (like ``main`` in the example), the simple alias (``$main``) will reference the first occurrence.
242-
Use type-prefixed aliases (``$memoryMain``, ``$chromaDbMain``) for explicit disambiguation.
242+
Use type-prefixed aliases (``$memoryMain``, ``$chromadbMain``) for explicit disambiguation.
243243

244244
Model Configuration
245245
-------------------
@@ -692,8 +692,8 @@ The ``ai:store:setup`` command prepares the required infrastructure for a store
692692
693693
$ php bin/console ai:store:setup <store>
694694
695-
# Setup the chroma_db store
696-
$ php bin/console ai:store:setup chroma_db.default
695+
# Setup the chromadb store
696+
$ php bin/console ai:store:setup chromadb.default
697697
698698
.. note::
699699

@@ -709,8 +709,8 @@ The ``ai:store:drop`` command drops the infrastructure for a store (e.g., remove
709709
710710
$ php bin/console ai:store:drop <store> --force
711711
712-
# Drop the chroma_db store
713-
$ php bin/console ai:store:drop chroma_db.default --force
712+
# Drop the chromadb store
713+
$ php bin/console ai:store:drop chromadb.default --force
714714
715715
.. warning::
716716

@@ -987,12 +987,12 @@ Once configured, vectorizers can be referenced by name in indexer configurations
987987
documents:
988988
loader: 'Symfony\AI\Store\Document\Loader\TextFileLoader'
989989
vectorizer: 'ai.vectorizer.openai_small'
990-
store: 'ai.store.chroma_db.documents'
990+
store: 'ai.store.chromadb.documents'
991991
992992
research:
993993
loader: 'Symfony\AI\Store\Document\Loader\TextFileLoader'
994994
vectorizer: 'ai.vectorizer.openai_large'
995-
store: 'ai.store.chroma_db.research'
995+
store: 'ai.store.chromadb.research'
996996
997997
knowledge_base:
998998
loader: 'Symfony\AI\Store\Document\Loader\InMemoryLoader'
@@ -1024,7 +1024,7 @@ Retrievers are defined in the ``retriever`` section of your configuration:
10241024
retriever:
10251025
default:
10261026
vectorizer: 'ai.vectorizer.openai_small'
1027-
store: 'ai.store.chroma_db.default'
1027+
store: 'ai.store.chromadb.default'
10281028
10291029
research:
10301030
vectorizer: 'ai.vectorizer.mistral_embed'

docs/components/store.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ you can use the ``bin/console ai:store:setup`` command to initialize the store a
119119
# ...
120120
121121
store:
122-
chroma_db:
122+
chromadb:
123123
symfonycon:
124124
collection: 'symfony_blog'
125125

docs/cookbook/rag-implementation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,15 @@ When using the AI Bundle, configure RAG with YAML:
289289
model: 'text-embedding-3-small'
290290
291291
store:
292-
chroma_db:
292+
chromadb:
293293
knowledge_base:
294294
collection: 'docs'
295295
296296
indexer:
297297
docs:
298298
loader: 'App\Document\Loader\DocLoader'
299299
vectorizer: 'ai.vectorizer.default'
300-
store: 'ai.store.chroma_db.knowledge_base'
300+
store: 'ai.store.chromadb.knowledge_base'
301301
302302
agent:
303303
rag_assistant:
@@ -311,7 +311,7 @@ Then use the indexer command to populate your store:
311311

312312
.. code-block:: terminal
313313
314-
$ php bin/console ai:store:setup chroma_db.knowledge_base
314+
$ php bin/console ai:store:setup chromadb.knowledge_base
315315
$ php bin/console ai:store:index docs
316316
317317
Performance Optimization

src/ai-bundle/config/options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@
564564
->end()
565565
->end()
566566
->end()
567-
->arrayNode('chroma_db')
567+
->arrayNode('chromadb')
568568
->useAttributeAsKey('name')
569569
->arrayPrototype()
570570
->children()

src/ai-bundle/src/AiBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde
10321032
}
10331033
}
10341034

1035-
if ('chroma_db' === $type) {
1035+
if ('chromadb' === $type) {
10361036
foreach ($stores as $name => $store) {
10371037
$definition = new Definition(ChromaDbStore::class);
10381038
$definition

src/ai-bundle/tests/DependencyInjection/AiBundleTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -687,18 +687,18 @@ public function testChromaDbStoreCanBeConfigured()
687687
$container = $this->buildContainer([
688688
'ai' => [
689689
'store' => [
690-
'chroma_db' => [
691-
'my_chroma_db_store' => [
690+
'chromadb' => [
691+
'my_chromadb_store' => [
692692
'collection' => 'foo',
693693
],
694694
],
695695
],
696696
],
697697
]);
698698

699-
$this->assertTrue($container->hasDefinition('ai.store.chroma_db.my_chroma_db_store'));
699+
$this->assertTrue($container->hasDefinition('ai.store.chromadb.my_chromadb_store'));
700700

701-
$definition = $container->getDefinition('ai.store.chroma_db.my_chroma_db_store');
701+
$definition = $container->getDefinition('ai.store.chromadb.my_chromadb_store');
702702
$this->assertSame(ChromaDbStore::class, $definition->getClass());
703703

704704
$this->assertTrue($definition->isLazy());
@@ -711,9 +711,9 @@ public function testChromaDbStoreCanBeConfigured()
711711
$this->assertSame([['interface' => StoreInterface::class]], $definition->getTag('proxy'));
712712
$this->assertTrue($definition->hasTag('ai.store'));
713713

714-
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chroma_db_my_chroma_db_store'));
715-
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromaDbStore'));
716-
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromaDbMyChromaDbStore'));
714+
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chromadb_my_chromadb_store'));
715+
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromadbStore'));
716+
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromadbMyChromadbStore'));
717717
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface'));
718718
}
719719

@@ -722,8 +722,8 @@ public function testChromaDbStoreWithCustomClientCanBeConfigured()
722722
$container = $this->buildContainer([
723723
'ai' => [
724724
'store' => [
725-
'chroma_db' => [
726-
'my_chroma_db_store_with_custom_client' => [
725+
'chromadb' => [
726+
'my_chromadb_store_with_custom_client' => [
727727
'client' => 'bar',
728728
'collection' => 'foo',
729729
],
@@ -732,9 +732,9 @@ public function testChromaDbStoreWithCustomClientCanBeConfigured()
732732
],
733733
]);
734734

735-
$this->assertTrue($container->hasDefinition('ai.store.chroma_db.my_chroma_db_store_with_custom_client'));
735+
$this->assertTrue($container->hasDefinition('ai.store.chromadb.my_chromadb_store_with_custom_client'));
736736

737-
$definition = $container->getDefinition('ai.store.chroma_db.my_chroma_db_store_with_custom_client');
737+
$definition = $container->getDefinition('ai.store.chromadb.my_chromadb_store_with_custom_client');
738738
$this->assertSame(ChromaDbStore::class, $definition->getClass());
739739

740740
$this->assertTrue($definition->isLazy());
@@ -747,9 +747,9 @@ public function testChromaDbStoreWithCustomClientCanBeConfigured()
747747
$this->assertSame([['interface' => StoreInterface::class]], $definition->getTag('proxy'));
748748
$this->assertTrue($definition->hasTag('ai.store'));
749749

750-
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chroma_db_my_chroma_db_store_with_custom_client'));
751-
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromaDbStoreWithCustomClient'));
752-
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromaDbMyChromaDbStoreWithCustomClient'));
750+
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chromadb_my_chromadb_store_with_custom_client'));
751+
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromadbStoreWithCustomClient'));
752+
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromadbMyChromadbStoreWithCustomClient'));
753753
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface'));
754754
}
755755

@@ -6719,11 +6719,11 @@ private function getFullConfig(): array
67196719
'strategy' => 'chebyshev',
67206720
],
67216721
],
6722-
'chroma_db' => [
6723-
'my_chroma_store' => [
6722+
'chromadb' => [
6723+
'my_chromadb_store' => [
67246724
'collection' => 'my_collection',
67256725
],
6726-
'my_chroma_db_store_with_custom_client' => [
6726+
'my_chromadb_store_with_custom_client' => [
67276727
'client' => 'bar',
67286728
'collection' => 'foo',
67296729
],

0 commit comments

Comments
 (0)