|
35 | 35 | use Symfony\AI\AiBundle\Profiler\TraceableToolbox; |
36 | 36 | use Symfony\AI\AiBundle\Security\Attribute\IsGrantedTool; |
37 | 37 | use Symfony\AI\Chat\Bridge\HttpFoundation\SessionStore; |
| 38 | +use Symfony\AI\Chat\Bridge\Meilisearch\MessageStore as MeilisearchMessageStore; |
38 | 39 | use Symfony\AI\Chat\MessageStoreInterface; |
39 | 40 | use Symfony\AI\Platform\Bridge\Anthropic\PlatformFactory as AnthropicPlatformFactory; |
40 | 41 | use Symfony\AI\Platform\Bridge\Azure\OpenAi\PlatformFactory as AzureOpenAiPlatformFactory; |
|
82 | 83 | use Symfony\AI\Store\Indexer; |
83 | 84 | use Symfony\AI\Store\IndexerInterface; |
84 | 85 | use Symfony\AI\Store\StoreInterface; |
| 86 | +use Symfony\Component\Clock\ClockInterface; |
85 | 87 | use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator; |
86 | 88 | use Symfony\Component\DependencyInjection\Attribute\Target; |
87 | 89 | use Symfony\Component\DependencyInjection\ChildDefinition; |
@@ -1331,6 +1333,24 @@ private function processMessageStoreConfig(string $type, array $messageStores, C |
1331 | 1333 | } |
1332 | 1334 | } |
1333 | 1335 |
|
| 1336 | + if ('meilisearch' === $type) { |
| 1337 | + foreach ($messageStores as $name => $messageStore) { |
| 1338 | + $definition = new Definition(MeilisearchMessageStore::class); |
| 1339 | + $definition |
| 1340 | + ->setArguments([ |
| 1341 | + $messageStore['endpoint'], |
| 1342 | + $messageStore['api_key'], |
| 1343 | + new Reference(ClockInterface::class), |
| 1344 | + $messageStore['index_name'], |
| 1345 | + ]) |
| 1346 | + ->addTag('ai.message_store'); |
| 1347 | + |
| 1348 | + $container->setDefinition('ai.message_store.'.$type.'.'.$name, $definition); |
| 1349 | + $container->registerAliasForArgument('ai.message_store.'.$type.'.'.$name, MessageStoreInterface::class, $name); |
| 1350 | + $container->registerAliasForArgument('ai.message_store.'.$type.'.'.$name, MessageStoreInterface::class, $type.'_'.$name); |
| 1351 | + } |
| 1352 | + } |
| 1353 | + |
1334 | 1354 | if ('session' === $type) { |
1335 | 1355 | foreach ($messageStores as $name => $messageStore) { |
1336 | 1356 | $definition = new Definition(SessionStore::class); |
|
0 commit comments