Skip to content

Commit 8814882

Browse files
committed
minor #1187 [Docs] Fix incorrect class references in documentation (OskarStark)
This PR was merged into the main branch. Discussion ---------- [Docs] Fix incorrect class references in documentation | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | yes | Issues | -- | License | MIT Commits ------- f688765 [Docs] Fix incorrect class references in documentation
2 parents 21385a8 + f688765 commit 8814882

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

docs/bundles/ai-bundle.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ To inject only specific tools, list them in the configuration:
868868
agent:
869869
my_agent:
870870
tools:
871-
- 'Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch'
871+
- 'Symfony\AI\Agent\Bridge\SimilaritySearch\SimilaritySearch'
872872
873873
To restrict the access to a tool, you can use the :class:`Symfony\\AI\\Agent\\Attribute\\IsGrantedTool` attribute, which
874874
works similar to :class:`Symfony\\Component\\Security\\Http\\Attribute\\IsGranted` attribute in `symfony/security-http`. For this to work,

docs/components/chat.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ for adding messages to the message store, and returning the messages from a stor
6666

6767
This leads to a store implementing two methods::
6868

69+
use Symfony\AI\Chat\MessageStoreInterface;
6970
use Symfony\AI\Platform\Message\MessageBag;
70-
use Symfony\AI\Store\MessageStoreInterface;
7171

7272
class MyCustomStore implements MessageStoreInterface
7373
{
@@ -91,8 +91,8 @@ to setup and drop the store.
9191

9292
This leads to a store implementing two methods::
9393

94-
use Symfony\AI\Store\ManagedStoreInterface;
95-
use Symfony\AI\Store\MessageStoreInterface;
94+
use Symfony\AI\Chat\ManagedStoreInterface;
95+
use Symfony\AI\Chat\MessageStoreInterface;
9696

9797
class MyCustomStore implements ManagedStoreInterface, MessageStoreInterface
9898
{

docs/components/store.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ for adding vectorized documents to the store, and querying the store for documen
139139

140140
This leads to a store implementing two methods::
141141

142+
use Symfony\AI\Platform\Vector\Vector;
143+
use Symfony\AI\Store\Document\VectorDocument;
142144
use Symfony\AI\Store\StoreInterface;
143-
use Symfony\AI\Store\Vector;
144-
use Symfony\AI\Store\VectorDocument;
145145

146146
class MyStore implements StoreInterface
147147
{
@@ -150,7 +150,7 @@ This leads to a store implementing two methods::
150150
// Implementation to add a document to the store
151151
}
152152

153-
public function query(Vector $vector, array $options = []): array
153+
public function query(Vector $vector, array $options = []): iterable
154154
{
155155
// Implementation to query the store for documents
156156
return $documents;

docs/components/store/local.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ InMemoryStore
1313

1414
Stores vectors in a PHP array. Data is not persisted and is lost when the PHP process ends::
1515

16-
use Symfony\AI\Store\Bridge\Local\InMemoryStore;
16+
use Symfony\AI\Store\InMemory\Store;
1717

18-
$store = new InMemoryStore();
18+
$store = new Store();
1919
$store->add($document1, $document2);
2020
$results = $store->query($vector);
2121

@@ -24,11 +24,11 @@ CacheStore
2424

2525
Stores vectors using a PSR-6 cache implementation. Persistence depends on the cache adapter used::
2626

27-
use Symfony\AI\Store\Bridge\Local\CacheStore;
27+
use Symfony\AI\Store\Bridge\Cache\Store;
2828
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
2929

3030
$cache = new FilesystemAdapter();
31-
$store = new CacheStore($cache);
31+
$store = new Store($cache);
3232
$store->add($document1, $document2);
3333
$results = $store->query($vector);
3434

@@ -39,9 +39,10 @@ Both stores support different distance calculation strategies::
3939

4040
use Symfony\AI\Store\Distance\DistanceCalculator;
4141
use Symfony\AI\Store\Distance\DistanceStrategy;
42+
use Symfony\AI\Store\InMemory\Store;
4243

4344
$calculator = new DistanceCalculator(DistanceStrategy::COSINE_DISTANCE);
44-
$store = new InMemoryStore($calculator);
45+
$store = new Store($calculator);
4546

4647
Available strategies:
4748

docs/cookbook/rag-implementation.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ Step 1: Initialize the Vector Store
4949

5050
First, create a store to hold your vector embeddings::
5151

52-
use Symfony\AI\Store\Bridge\Local\InMemoryStore;
52+
use Symfony\AI\Store\InMemory\Store;
5353

54-
$store = new InMemoryStore();
54+
$store = new Store();
5555

5656
For production use, consider using persistent stores like ChromaDB, Pinecone, or MongoDB Atlas.
5757

@@ -110,8 +110,8 @@ Step 4: Configure Similarity Search Tool
110110

111111
Create a tool that performs semantic search on your vector store::
112112

113+
use Symfony\AI\Agent\Bridge\SimilaritySearch\SimilaritySearch;
113114
use Symfony\AI\Agent\Toolbox\AgentProcessor;
114-
use Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch;
115115
use Symfony\AI\Agent\Toolbox\Toolbox;
116116

117117
$similaritySearch = new SimilaritySearch($vectorizer, $store);
@@ -169,9 +169,9 @@ Vector Store Selection
169169

170170
For production environments, use persistent vector stores like ChromaDB::
171171

172-
use Symfony\AI\Store\Bridge\ChromaDB\ChromaStore;
172+
use Symfony\AI\Store\Bridge\ChromaDb\Store;
173173

174-
$store = new ChromaStore(
174+
$store = new Store(
175175
$httpClient,
176176
'http://localhost:8000',
177177
'my_collection'
@@ -305,7 +305,7 @@ When using the AI Bundle, configure RAG with YAML:
305305
prompt:
306306
text: 'Answer questions using only the SimilaritySearch tool. If you cannot find relevant information, say so.'
307307
tools:
308-
- 'Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch'
308+
- 'Symfony\AI\Agent\Bridge\SimilaritySearch\SimilaritySearch'
309309
310310
Then use the indexer command to populate your store:
311311

0 commit comments

Comments
 (0)