Skip to content

Commit 1baa466

Browse files
committed
[Chat] Rename Cache Store to MessageStore
1 parent 611b83c commit 1baa466

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

examples/chat/persistent-chat-cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
use Symfony\AI\Agent\Agent;
13-
use Symfony\AI\Chat\Bridge\Cache\Store as CacheStore;
13+
use Symfony\AI\Chat\Bridge\Cache\MessageStore as CacheStore;
1414
use Symfony\AI\Chat\Chat;
1515
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
1616
use Symfony\AI\Platform\Message\Message;

examples/commands/message-stores.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Doctrine\DBAL\DriverManager;
1515
use MongoDB\Client as MongoDbClient;
16-
use Symfony\AI\Chat\Bridge\Cache\Store as CacheStore;
16+
use Symfony\AI\Chat\Bridge\Cache\MessageStore as CacheStore;
1717
use Symfony\AI\Chat\Bridge\Doctrine\DoctrineDbalMessageStore;
1818
use Symfony\AI\Chat\Bridge\HttpFoundation\SessionStore;
1919
use Symfony\AI\Chat\Bridge\Meilisearch\MessageStore as MeilisearchMessageStore;

src/ai-bundle/src/AiBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
use Symfony\AI\AiBundle\Profiler\TraceablePlatform;
3737
use Symfony\AI\AiBundle\Profiler\TraceableToolbox;
3838
use Symfony\AI\AiBundle\Security\Attribute\IsGrantedTool;
39-
use Symfony\AI\Chat\Bridge\Cache\Store as CacheMessageStore;
39+
use Symfony\AI\Chat\Bridge\Cache\MessageStore as CacheMessageStore;
4040
use Symfony\AI\Chat\Bridge\Cloudflare\MessageStore as CloudflareMessageStore;
4141
use Symfony\AI\Chat\Bridge\Doctrine\DoctrineDbalMessageStore;
4242
use Symfony\AI\Chat\Bridge\HttpFoundation\SessionStore;

src/chat/src/Bridge/Cache/Store.php renamed to src/chat/src/Bridge/Cache/MessageStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* @author Christopher Hertel <[email protected]>
2222
*/
23-
final class Store implements ManagedStoreInterface, MessageStoreInterface
23+
final class MessageStore implements ManagedStoreInterface, MessageStoreInterface
2424
{
2525
public function __construct(
2626
private readonly CacheItemPoolInterface $cache,

src/chat/tests/Bridge/Cache/StoreTest.php renamed to src/chat/tests/Bridge/Cache/MessageStoreTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Psr\Cache\CacheItemInterface;
1616
use Psr\Cache\CacheItemPoolInterface;
17-
use Symfony\AI\Chat\Bridge\Cache\Store;
17+
use Symfony\AI\Chat\Bridge\Cache\MessageStore;
1818
use Symfony\AI\Platform\Message\Message;
1919
use Symfony\AI\Platform\Message\MessageBag;
2020

21-
final class StoreTest extends TestCase
21+
final class MessageStoreTest extends TestCase
2222
{
2323
public function testSetupStoresEmptyMessageBag()
2424
{
@@ -43,7 +43,7 @@ public function testSetupStoresEmptyMessageBag()
4343
->method('save')
4444
->with($cacheItem);
4545

46-
$store = new Store($cache, 'test_key');
46+
$store = new MessageStore($cache, 'test_key');
4747
$store->setup();
4848
}
4949

@@ -64,7 +64,7 @@ public function testSetupWithCustomTtl()
6464
->method('save')
6565
->with($cacheItem);
6666

67-
$store = new Store($cache, 'test_key', 3600);
67+
$store = new MessageStore($cache, 'test_key', 3600);
6868
$store->setup();
6969
}
7070

@@ -94,7 +94,7 @@ public function testSaveStoresMessageBag()
9494
->method('save')
9595
->with($cacheItem);
9696

97-
$store = new Store($cache, 'messages');
97+
$store = new MessageStore($cache, 'messages');
9898
$store->save($messageBag);
9999
}
100100

@@ -119,7 +119,7 @@ public function testLoadReturnsStoredMessages()
119119
->method('get')
120120
->willReturn($messageBag);
121121

122-
$store = new Store($cache, 'test_key');
122+
$store = new MessageStore($cache, 'test_key');
123123
$result = $store->load();
124124

125125
$this->assertSame($messageBag, $result);
@@ -143,7 +143,7 @@ public function testLoadReturnsEmptyMessageBagWhenCacheMiss()
143143
$cacheItem->expects($this->never())
144144
->method('get');
145145

146-
$store = new Store($cache, 'test_key');
146+
$store = new MessageStore($cache, 'test_key');
147147
$result = $store->load();
148148

149149
$this->assertInstanceOf(MessageBag::class, $result);
@@ -158,7 +158,7 @@ public function testDropDeletesCacheItem()
158158
->method('deleteItem')
159159
->with('messages');
160160

161-
$store = new Store($cache, 'messages');
161+
$store = new MessageStore($cache, 'messages');
162162
$store->drop();
163163
}
164164
}

0 commit comments

Comments
 (0)