Skip to content

Commit 1b5c764

Browse files
committed
minor #318 [Store] Introduce local bridge for in-memory and cache based stores (chr-hertel)
This PR was merged into the main branch. Discussion ---------- [Store] Introduce local bridge for in-memory and cache based stores | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | | License | MIT Didn't catch that before - I'd rather keep the root clean and i don't think everyone needs this. "local" was just my best idea at this point - input/feedback welcome! Sits on top of #317 Commits ------- 8ce4733 Introduce local bridge for in-memory and cache based stores
2 parents ddf2e32 + 8ce4733 commit 1b5c764

File tree

9 files changed

+18
-16
lines changed

9 files changed

+18
-16
lines changed

examples/rag/cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
2020
use Symfony\AI\Platform\Message\Message;
2121
use Symfony\AI\Platform\Message\MessageBag;
22-
use Symfony\AI\Store\CacheStore;
22+
use Symfony\AI\Store\Bridge\Local\CacheStore;
2323
use Symfony\AI\Store\Document\Metadata;
2424
use Symfony\AI\Store\Document\TextDocument;
2525
use Symfony\AI\Store\Document\Vectorizer;

examples/rag/in-memory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
2020
use Symfony\AI\Platform\Message\Message;
2121
use Symfony\AI\Platform\Message\MessageBag;
22+
use Symfony\AI\Store\Bridge\Local\InMemoryStore;
2223
use Symfony\AI\Store\Document\Metadata;
2324
use Symfony\AI\Store\Document\TextDocument;
2425
use Symfony\AI\Store\Document\Vectorizer;
2526
use Symfony\AI\Store\Indexer;
26-
use Symfony\AI\Store\InMemoryStore;
2727
use Symfony\Component\Uid\Uuid;
2828

2929
require_once dirname(__DIR__).'/bootstrap.php';

src/ai-bundle/src/AiBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@
4242
use Symfony\AI\Store\Bridge\Azure\SearchStore as AzureSearchStore;
4343
use Symfony\AI\Store\Bridge\ChromaDb\Store as ChromaDbStore;
4444
use Symfony\AI\Store\Bridge\ClickHouse\Store as ClickHouseStore;
45+
use Symfony\AI\Store\Bridge\Local\CacheStore;
46+
use Symfony\AI\Store\Bridge\Local\InMemoryStore;
4547
use Symfony\AI\Store\Bridge\Meilisearch\Store as MeilisearchStore;
4648
use Symfony\AI\Store\Bridge\MongoDb\Store as MongoDbStore;
4749
use Symfony\AI\Store\Bridge\Neo4j\Store as Neo4jStore;
4850
use Symfony\AI\Store\Bridge\Pinecone\Store as PineconeStore;
4951
use Symfony\AI\Store\Bridge\Qdrant\Store as QdrantStore;
5052
use Symfony\AI\Store\Bridge\SurrealDb\Store as SurrealDbStore;
5153
use Symfony\AI\Store\Bridge\Typesense\Store as TypesenseStore;
52-
use Symfony\AI\Store\CacheStore;
5354
use Symfony\AI\Store\Document\Vectorizer;
5455
use Symfony\AI\Store\Indexer;
55-
use Symfony\AI\Store\InMemoryStore;
5656
use Symfony\AI\Store\StoreInterface;
5757
use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;
5858
use Symfony\Component\DependencyInjection\Attribute\Target;

src/store/src/CacheStore.php renamed to src/store/src/Bridge/Local/CacheStore.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\AI\Store;
12+
namespace Symfony\AI\Store\Bridge\Local;
1313

1414
use Psr\Cache\CacheItemPoolInterface;
1515
use Symfony\AI\Platform\Vector\Vector;
1616
use Symfony\AI\Store\Document\Metadata;
1717
use Symfony\AI\Store\Document\VectorDocument;
1818
use Symfony\AI\Store\Exception\RuntimeException;
19+
use Symfony\AI\Store\StoreInterface;
1920
use Symfony\Component\Uid\Uuid;
2021
use Symfony\Contracts\Cache\CacheInterface;
2122

src/store/src/DistanceCalculator.php renamed to src/store/src/Bridge/Local/DistanceCalculator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\AI\Store;
12+
namespace Symfony\AI\Store\Bridge\Local;
1313

1414
use Symfony\AI\Platform\Vector\Vector;
1515
use Symfony\AI\Store\Document\VectorDocument;

src/store/src/DistanceStrategy.php renamed to src/store/src/Bridge/Local/DistanceStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\AI\Store;
12+
namespace Symfony\AI\Store\Bridge\Local;
1313

1414
/**
1515
* @author Guillaume Loulier <[email protected]>

src/store/src/InMemoryStore.php renamed to src/store/src/Bridge/Local/InMemoryStore.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\AI\Store;
12+
namespace Symfony\AI\Store\Bridge\Local;
1313

1414
use Symfony\AI\Platform\Vector\Vector;
1515
use Symfony\AI\Store\Document\VectorDocument;
16+
use Symfony\AI\Store\StoreInterface;
1617

1718
/**
1819
* @author Guillaume Loulier <[email protected]>

src/store/tests/CacheStoreTest.php renamed to src/store/tests/Bridge/Local/CacheStoreTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\AI\Store\Tests;
12+
namespace Symfony\AI\Store\Tests\Bridge\Local;
1313

1414
use PHPUnit\Framework\Attributes\CoversClass;
1515
use PHPUnit\Framework\Attributes\UsesClass;
1616
use PHPUnit\Framework\TestCase;
1717
use Symfony\AI\Platform\Vector\Vector;
18-
use Symfony\AI\Store\CacheStore;
19-
use Symfony\AI\Store\DistanceCalculator;
20-
use Symfony\AI\Store\DistanceStrategy;
18+
use Symfony\AI\Store\Bridge\Local\CacheStore;
19+
use Symfony\AI\Store\Bridge\Local\DistanceCalculator;
20+
use Symfony\AI\Store\Bridge\Local\DistanceStrategy;
2121
use Symfony\AI\Store\Document\VectorDocument;
2222
use Symfony\Component\Cache\Adapter\ArrayAdapter;
2323
use Symfony\Component\Uid\Uuid;

src/store/tests/InMemoryStoreTest.php renamed to src/store/tests/Bridge/Local/InMemoryStoreTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\AI\Store\Tests;
12+
namespace Symfony\AI\Store\Tests\Bridge\Local;
1313

1414
use PHPUnit\Framework\Attributes\CoversClass;
1515
use PHPUnit\Framework\Attributes\UsesClass;
1616
use PHPUnit\Framework\TestCase;
1717
use Symfony\AI\Platform\Vector\Vector;
18-
use Symfony\AI\Store\DistanceCalculator;
19-
use Symfony\AI\Store\DistanceStrategy;
18+
use Symfony\AI\Store\Bridge\Local\DistanceCalculator;
19+
use Symfony\AI\Store\Bridge\Local\DistanceStrategy;
20+
use Symfony\AI\Store\Bridge\Local\InMemoryStore;
2021
use Symfony\AI\Store\Document\VectorDocument;
21-
use Symfony\AI\Store\InMemoryStore;
2222
use Symfony\Component\Uid\Uuid;
2323

2424
#[CoversClass(InMemoryStore::class)]

0 commit comments

Comments
 (0)