From a0b4439349c5aa3917f81918980dcfab028c379e Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Sun, 7 Dec 2025 14:02:20 +0100 Subject: [PATCH] Rename chroma_db config key to chromadb --- demo/config/packages/ai.yaml | 8 ++--- docs/bundles/ai-bundle.rst | 26 +++++++------- docs/components/store.rst | 2 +- docs/cookbook/rag-implementation.rst | 6 ++-- src/ai-bundle/config/options.php | 2 +- src/ai-bundle/src/AiBundle.php | 2 +- .../DependencyInjection/AiBundleTest.php | 34 +++++++++---------- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/demo/config/packages/ai.yaml b/demo/config/packages/ai.yaml index 06499c33e..a34557c8e 100644 --- a/demo/config/packages/ai.yaml +++ b/demo/config/packages/ai.yaml @@ -82,7 +82,7 @@ ai: technical: ['bug', 'problem', 'technical', 'error', 'code', 'debug'] fallback: 'fallback' store: - chroma_db: + chromadb: symfonycon: collection: 'symfony_blog' vectorizer: @@ -99,11 +99,11 @@ ai: - 'Symfony\AI\Store\Document\Transformer\TextSplitTransformer' - 'Symfony\AI\Store\Document\Transformer\TextTrimTransformer' vectorizer: 'ai.vectorizer.openai' - store: 'ai.store.chroma_db.symfonycon' + store: 'ai.store.chromadb.symfonycon' retriever: blog: vectorizer: 'ai.vectorizer.openai' - store: 'ai.store.chroma_db.symfonycon' + store: 'ai.store.chromadb.symfonycon' services: _defaults: @@ -112,7 +112,7 @@ services: Symfony\AI\Agent\Bridge\SimilaritySearch\SimilaritySearch: $vectorizer: '@ai.vectorizer.openai' - $store: '@ai.store.chroma_db.symfonycon' + $store: '@ai.store.chromadb.symfonycon' Symfony\AI\Store\Document\Loader\RssFeedLoader: ~ Symfony\AI\Store\Document\Transformer\TextSplitTransformer: ~ diff --git a/docs/bundles/ai-bundle.rst b/docs/bundles/ai-bundle.rst index d8e209857..f70a5bb1b 100644 --- a/docs/bundles/ai-bundle.rst +++ b/docs/bundles/ai-bundle.rst @@ -102,7 +102,7 @@ Advanced Example with Multiple Agents model: 'text-to-speech' tools: false store: - chroma_db: + chromadb: # multiple collections possible per type default: collection: 'my_collection' @@ -129,7 +129,7 @@ Advanced Example with Multiple Agents default: loader: 'Symfony\AI\Store\Document\Loader\InMemoryLoader' vectorizer: 'ai.vectorizer.openai_embeddings' - store: 'ai.store.chroma_db.default' + store: 'ai.store.chromadb.default' research: loader: 'Symfony\AI\Store\Document\Loader\TextFileLoader' @@ -212,7 +212,7 @@ For each configured store, the bundle automatically creates two types of aliases strategy: 'cosine' products: strategy: 'manhattan' - chroma_db: + chromadb: main: collection: 'documents' @@ -220,7 +220,7 @@ From the configuration above, the following aliases are automatically registered - ``StoreInterface $main`` - References the memory store (first occurrence) - ``StoreInterface $memoryMain`` - Explicitly references the memory store -- ``StoreInterface $chromaDbMain`` - Explicitly references the chroma_db store +- ``StoreInterface $chromadbMain`` - Explicitly references the chromadb store - ``StoreInterface $products`` - References the memory products store - ``StoreInterface $memoryProducts`` - Explicitly references the memory products store @@ -232,14 +232,14 @@ You can inject stores into your services using the generated aliases:: { public function __construct( private StoreInterface $main, // Uses memory store (first occurrence) - private StoreInterface $chromaDbMain, // Explicitly uses chroma_db store + private StoreInterface $chromadbMain, // Explicitly uses chromadb store private StoreInterface $memoryProducts, // Explicitly uses memory products store ) { } } When multiple stores share the same name (like ``main`` in the example), the simple alias (``$main``) will reference the first occurrence. -Use type-prefixed aliases (``$memoryMain``, ``$chromaDbMain``) for explicit disambiguation. +Use type-prefixed aliases (``$memoryMain``, ``$chromadbMain``) for explicit disambiguation. Model Configuration ------------------- @@ -692,8 +692,8 @@ The ``ai:store:setup`` command prepares the required infrastructure for a store $ php bin/console ai:store:setup - # Setup the chroma_db store - $ php bin/console ai:store:setup chroma_db.default + # Setup the chromadb store + $ php bin/console ai:store:setup chromadb.default .. note:: @@ -709,8 +709,8 @@ The ``ai:store:drop`` command drops the infrastructure for a store (e.g., remove $ php bin/console ai:store:drop --force - # Drop the chroma_db store - $ php bin/console ai:store:drop chroma_db.default --force + # Drop the chromadb store + $ php bin/console ai:store:drop chromadb.default --force .. warning:: @@ -987,12 +987,12 @@ Once configured, vectorizers can be referenced by name in indexer configurations documents: loader: 'Symfony\AI\Store\Document\Loader\TextFileLoader' vectorizer: 'ai.vectorizer.openai_small' - store: 'ai.store.chroma_db.documents' + store: 'ai.store.chromadb.documents' research: loader: 'Symfony\AI\Store\Document\Loader\TextFileLoader' vectorizer: 'ai.vectorizer.openai_large' - store: 'ai.store.chroma_db.research' + store: 'ai.store.chromadb.research' knowledge_base: loader: 'Symfony\AI\Store\Document\Loader\InMemoryLoader' @@ -1024,7 +1024,7 @@ Retrievers are defined in the ``retriever`` section of your configuration: retriever: default: vectorizer: 'ai.vectorizer.openai_small' - store: 'ai.store.chroma_db.default' + store: 'ai.store.chromadb.default' research: vectorizer: 'ai.vectorizer.mistral_embed' diff --git a/docs/components/store.rst b/docs/components/store.rst index 7b518944c..6116f1fbf 100644 --- a/docs/components/store.rst +++ b/docs/components/store.rst @@ -119,7 +119,7 @@ you can use the ``bin/console ai:store:setup`` command to initialize the store a # ... store: - chroma_db: + chromadb: symfonycon: collection: 'symfony_blog' diff --git a/docs/cookbook/rag-implementation.rst b/docs/cookbook/rag-implementation.rst index 8a208abb1..d406dbcde 100644 --- a/docs/cookbook/rag-implementation.rst +++ b/docs/cookbook/rag-implementation.rst @@ -289,7 +289,7 @@ When using the AI Bundle, configure RAG with YAML: model: 'text-embedding-3-small' store: - chroma_db: + chromadb: knowledge_base: collection: 'docs' @@ -297,7 +297,7 @@ When using the AI Bundle, configure RAG with YAML: docs: loader: 'App\Document\Loader\DocLoader' vectorizer: 'ai.vectorizer.default' - store: 'ai.store.chroma_db.knowledge_base' + store: 'ai.store.chromadb.knowledge_base' agent: rag_assistant: @@ -311,7 +311,7 @@ Then use the indexer command to populate your store: .. code-block:: terminal - $ php bin/console ai:store:setup chroma_db.knowledge_base + $ php bin/console ai:store:setup chromadb.knowledge_base $ php bin/console ai:store:index docs Performance Optimization diff --git a/src/ai-bundle/config/options.php b/src/ai-bundle/config/options.php index 67e68cae0..26a0f726c 100644 --- a/src/ai-bundle/config/options.php +++ b/src/ai-bundle/config/options.php @@ -564,7 +564,7 @@ ->end() ->end() ->end() - ->arrayNode('chroma_db') + ->arrayNode('chromadb') ->useAttributeAsKey('name') ->arrayPrototype() ->children() diff --git a/src/ai-bundle/src/AiBundle.php b/src/ai-bundle/src/AiBundle.php index 8ed019be3..7fada7854 100644 --- a/src/ai-bundle/src/AiBundle.php +++ b/src/ai-bundle/src/AiBundle.php @@ -1032,7 +1032,7 @@ private function processStoreConfig(string $type, array $stores, ContainerBuilde } } - if ('chroma_db' === $type) { + if ('chromadb' === $type) { foreach ($stores as $name => $store) { $definition = new Definition(ChromaDbStore::class); $definition diff --git a/src/ai-bundle/tests/DependencyInjection/AiBundleTest.php b/src/ai-bundle/tests/DependencyInjection/AiBundleTest.php index af64384b8..c8c75c2fa 100644 --- a/src/ai-bundle/tests/DependencyInjection/AiBundleTest.php +++ b/src/ai-bundle/tests/DependencyInjection/AiBundleTest.php @@ -687,8 +687,8 @@ public function testChromaDbStoreCanBeConfigured() $container = $this->buildContainer([ 'ai' => [ 'store' => [ - 'chroma_db' => [ - 'my_chroma_db_store' => [ + 'chromadb' => [ + 'my_chromadb_store' => [ 'collection' => 'foo', ], ], @@ -696,9 +696,9 @@ public function testChromaDbStoreCanBeConfigured() ], ]); - $this->assertTrue($container->hasDefinition('ai.store.chroma_db.my_chroma_db_store')); + $this->assertTrue($container->hasDefinition('ai.store.chromadb.my_chromadb_store')); - $definition = $container->getDefinition('ai.store.chroma_db.my_chroma_db_store'); + $definition = $container->getDefinition('ai.store.chromadb.my_chromadb_store'); $this->assertSame(ChromaDbStore::class, $definition->getClass()); $this->assertTrue($definition->isLazy()); @@ -711,9 +711,9 @@ public function testChromaDbStoreCanBeConfigured() $this->assertSame([['interface' => StoreInterface::class]], $definition->getTag('proxy')); $this->assertTrue($definition->hasTag('ai.store')); - $this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chroma_db_my_chroma_db_store')); - $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromaDbStore')); - $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromaDbMyChromaDbStore')); + $this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chromadb_my_chromadb_store')); + $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromadbStore')); + $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromadbMyChromadbStore')); $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface')); } @@ -722,8 +722,8 @@ public function testChromaDbStoreWithCustomClientCanBeConfigured() $container = $this->buildContainer([ 'ai' => [ 'store' => [ - 'chroma_db' => [ - 'my_chroma_db_store_with_custom_client' => [ + 'chromadb' => [ + 'my_chromadb_store_with_custom_client' => [ 'client' => 'bar', 'collection' => 'foo', ], @@ -732,9 +732,9 @@ public function testChromaDbStoreWithCustomClientCanBeConfigured() ], ]); - $this->assertTrue($container->hasDefinition('ai.store.chroma_db.my_chroma_db_store_with_custom_client')); + $this->assertTrue($container->hasDefinition('ai.store.chromadb.my_chromadb_store_with_custom_client')); - $definition = $container->getDefinition('ai.store.chroma_db.my_chroma_db_store_with_custom_client'); + $definition = $container->getDefinition('ai.store.chromadb.my_chromadb_store_with_custom_client'); $this->assertSame(ChromaDbStore::class, $definition->getClass()); $this->assertTrue($definition->isLazy()); @@ -747,9 +747,9 @@ public function testChromaDbStoreWithCustomClientCanBeConfigured() $this->assertSame([['interface' => StoreInterface::class]], $definition->getTag('proxy')); $this->assertTrue($definition->hasTag('ai.store')); - $this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chroma_db_my_chroma_db_store_with_custom_client')); - $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromaDbStoreWithCustomClient')); - $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromaDbMyChromaDbStoreWithCustomClient')); + $this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $chromadb_my_chromadb_store_with_custom_client')); + $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myChromadbStoreWithCustomClient')); + $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $chromadbMyChromadbStoreWithCustomClient')); $this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface')); } @@ -6719,11 +6719,11 @@ private function getFullConfig(): array 'strategy' => 'chebyshev', ], ], - 'chroma_db' => [ - 'my_chroma_store' => [ + 'chromadb' => [ + 'my_chromadb_store' => [ 'collection' => 'my_collection', ], - 'my_chroma_db_store_with_custom_client' => [ + 'my_chromadb_store_with_custom_client' => [ 'client' => 'bar', 'collection' => 'foo', ],