Skip to content

Commit 656dc49

Browse files
committed
feature #1066 [Chat] Split Local bridge into Cache and Memory bridges (OskarStark)
This PR was merged into the main branch. Discussion ---------- [Chat] Split Local bridge into Cache and Memory bridges | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Docs? | no | Issues | Follows #1063 | License | MIT Commits ------- 7fa18a4 [Chat] Split Local bridge into Cache and Memory bridges
2 parents 2655376 + 7fa18a4 commit 656dc49

File tree

13 files changed

+33
-33
lines changed

13 files changed

+33
-33
lines changed

docs/components/chat.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To initiate a chat, you need to instantiate the ``Symfony\AI\Chat\Chat`` along
1818
with a ``Symfony\AI\Agent\AgentInterface`` and a ``Symfony\AI\Chat\MessageStoreInterface``::
1919

2020
use Symfony\AI\Agent\Agent;
21-
use Symfony\AI\Chat\Bridge\Local\InMemoryStore;
21+
use Symfony\AI\Chat\Bridge\Memory\Store as InMemoryStore;
2222
use Symfony\AI\Chat\Chat;
2323
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
2424
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;

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\Local\CacheStore;
13+
use Symfony\AI\Chat\Bridge\Cache\Store as CacheStore;
1414
use Symfony\AI\Chat\Chat;
1515
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
1616
use Symfony\AI\Platform\Message\Message;

examples/chat/persistent-chat.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\Local\InMemoryStore;
13+
use Symfony\AI\Chat\Bridge\Memory\Store as InMemoryStore;
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
use Doctrine\DBAL\DriverManager;
1515
use MongoDB\Client as MongoDbClient;
16+
use Symfony\AI\Chat\Bridge\Cache\Store as CacheStore;
1617
use Symfony\AI\Chat\Bridge\Doctrine\DoctrineDbalMessageStore;
1718
use Symfony\AI\Chat\Bridge\HttpFoundation\SessionStore;
18-
use Symfony\AI\Chat\Bridge\Local\CacheStore;
19-
use Symfony\AI\Chat\Bridge\Local\InMemoryStore;
2019
use Symfony\AI\Chat\Bridge\Meilisearch\MessageStore as MeilisearchMessageStore;
20+
use Symfony\AI\Chat\Bridge\Memory\Store as InMemoryStore;
2121
use Symfony\AI\Chat\Bridge\MongoDb\MessageStore as MongoDbMessageStore;
2222
use Symfony\AI\Chat\Bridge\Pogocache\MessageStore as PogocacheMessageStore;
2323
use Symfony\AI\Chat\Bridge\Redis\MessageStore as RedisMessageStore;

src/ai-bundle/src/AiBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
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;
3940
use Symfony\AI\Chat\Bridge\Cloudflare\MessageStore as CloudflareMessageStore;
4041
use Symfony\AI\Chat\Bridge\Doctrine\DoctrineDbalMessageStore;
4142
use Symfony\AI\Chat\Bridge\HttpFoundation\SessionStore;
42-
use Symfony\AI\Chat\Bridge\Local\CacheStore as CacheMessageStore;
43-
use Symfony\AI\Chat\Bridge\Local\InMemoryStore as InMemoryMessageStore;
4443
use Symfony\AI\Chat\Bridge\Meilisearch\MessageStore as MeilisearchMessageStore;
44+
use Symfony\AI\Chat\Bridge\Memory\Store as InMemoryMessageStore;
4545
use Symfony\AI\Chat\Bridge\MongoDb\MessageStore as MongoDbMessageStore;
4646
use Symfony\AI\Chat\Bridge\Pogocache\MessageStore as PogocacheMessageStore;
4747
use Symfony\AI\Chat\Bridge\Redis\MessageStore as RedisMessageStore;

src/ai-bundle/tests/Profiler/DataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Symfony\AI\AiBundle\Profiler\TraceableChat;
1818
use Symfony\AI\AiBundle\Profiler\TraceableMessageStore;
1919
use Symfony\AI\AiBundle\Profiler\TraceablePlatform;
20-
use Symfony\AI\Chat\Bridge\Local\InMemoryStore;
20+
use Symfony\AI\Chat\Bridge\Memory\Store as InMemoryStore;
2121
use Symfony\AI\Chat\Chat;
2222
use Symfony\AI\Platform\Message\Content\Text;
2323
use Symfony\AI\Platform\Message\Message;

src/ai-bundle/tests/Profiler/TraceableChatTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\AI\Agent\AgentInterface;
1616
use Symfony\AI\AiBundle\Profiler\TraceableChat;
17-
use Symfony\AI\Chat\Bridge\Local\InMemoryStore;
17+
use Symfony\AI\Chat\Bridge\Memory\Store as InMemoryStore;
1818
use Symfony\AI\Chat\Chat;
1919
use Symfony\AI\Platform\Message\Message;
2020
use Symfony\AI\Platform\Message\MessageBag;

src/ai-bundle/tests/Profiler/TraceableMessageStoreTest.php

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

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\AI\AiBundle\Profiler\TraceableMessageStore;
16-
use Symfony\AI\Chat\Bridge\Local\InMemoryStore;
16+
use Symfony\AI\Chat\Bridge\Memory\Store as InMemoryStore;
1717
use Symfony\AI\Platform\Message\Message;
1818
use Symfony\AI\Platform\Message\MessageBag;
1919
use Symfony\Component\Clock\MonotonicClock;
Lines changed: 2 additions & 2 deletions
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\Chat\Bridge\Local;
12+
namespace Symfony\AI\Chat\Bridge\Cache;
1313

1414
use Psr\Cache\CacheItemPoolInterface;
1515
use Symfony\AI\Agent\Exception\RuntimeException;
@@ -20,7 +20,7 @@
2020
/**
2121
* @author Christopher Hertel <[email protected]>
2222
*/
23-
final class CacheStore implements ManagedStoreInterface, MessageStoreInterface
23+
final class Store implements ManagedStoreInterface, MessageStoreInterface
2424
{
2525
public function __construct(
2626
private readonly CacheItemPoolInterface $cache,

src/chat/src/Bridge/Local/InMemoryStore.php renamed to src/chat/src/Bridge/Memory/Store.php

Lines changed: 2 additions & 2 deletions
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\Chat\Bridge\Local;
12+
namespace Symfony\AI\Chat\Bridge\Memory;
1313

1414
use Symfony\AI\Chat\ManagedStoreInterface;
1515
use Symfony\AI\Chat\MessageStoreInterface;
@@ -18,7 +18,7 @@
1818
/**
1919
* @author Christopher Hertel <[email protected]>
2020
*/
21-
final class InMemoryStore implements ManagedStoreInterface, MessageStoreInterface
21+
final class Store implements ManagedStoreInterface, MessageStoreInterface
2222
{
2323
/**
2424
* @var MessageBag[]

0 commit comments

Comments
 (0)