diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index e814b28de..b8c19fea6 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -15,7 +15,7 @@ concurrency: cancel-in-progress: true env: - REQUIRED_PHP_EXTENSIONS: 'mongodb' + REQUIRED_PHP_EXTENSIONS: 'mongodb, redis' jobs: examples: diff --git a/examples/.env b/examples/.env index 84bc3bd5b..f7ad3c198 100644 --- a/examples/.env +++ b/examples/.env @@ -168,3 +168,6 @@ SUPABASE_MATCH_FUNCTION=match_documents # Pogocache (message store) POGOCACHE_HOST=http://127.0.0.1:9401 POGOCACHE_PASSWORD=symfony + +# Redis (store) +REDIS_HOST=localhost diff --git a/examples/commands/stores.php b/examples/commands/stores.php index 90480d21a..d490246df 100644 --- a/examples/commands/stores.php +++ b/examples/commands/stores.php @@ -24,6 +24,7 @@ use Symfony\AI\Store\Bridge\Neo4j\Store as Neo4jStore; use Symfony\AI\Store\Bridge\Postgres\Store as PostgresStore; use Symfony\AI\Store\Bridge\Qdrant\Store as QdrantStore; +use Symfony\AI\Store\Bridge\Redis\Store as RedisStore; use Symfony\AI\Store\Bridge\SurrealDb\Store as SurrealDbStore; use Symfony\AI\Store\Bridge\Typesense\Store as TypesenseStore; use Symfony\AI\Store\Bridge\Weaviate\Store as WeaviateStore; @@ -88,6 +89,13 @@ env('QDRANT_SERVICE_API_KEY'), 'symfony', ), + 'redis' => static fn (): RedisStore => new RedisStore( + new Redis([ + 'host' => env('REDIS_HOST'), + 'port' => 6379, + ]), + 'symfony' + ), 'surrealdb' => static fn (): SurrealDbStore => new SurrealDbStore( httpClient: http_client(), endpointUrl: env('SURREALDB_HOST'), diff --git a/examples/composer.json b/examples/composer.json index 9c83db614..6ff168896 100644 --- a/examples/composer.json +++ b/examples/composer.json @@ -6,6 +6,7 @@ "require": { "php": ">=8.2", "ext-pdo": "*", + "ext-redis": "*", "async-aws/bedrock-runtime": "^1.1", "codewithkyrian/chromadb-php": "^0.4.0", "codewithkyrian/transformers": "^0.6.2", diff --git a/examples/rag/redis.php b/examples/rag/redis.php index a0d1ca7f4..c5f4973ce 100644 --- a/examples/rag/redis.php +++ b/examples/rag/redis.php @@ -14,7 +14,6 @@ use Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch; use Symfony\AI\Agent\Toolbox\Toolbox; use Symfony\AI\Fixtures\Movies; -use Symfony\AI\Platform\Bridge\OpenAi\Embeddings; use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag;