Skip to content

Commit 115bbb4

Browse files
committed
refactor(examples): Redis added for commands
1 parent edbfbcc commit 115bbb4

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

.github/workflows/integration-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
env:
18-
REQUIRED_PHP_EXTENSIONS: 'mongodb'
18+
REQUIRED_PHP_EXTENSIONS: 'mongodb, redis'
1919

2020
jobs:
2121
examples:

examples/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,6 @@ SUPABASE_MATCH_FUNCTION=match_documents
168168
# Pogocache (message store)
169169
POGOCACHE_HOST=http://127.0.0.1:9401
170170
POGOCACHE_PASSWORD=symfony
171+
172+
# Redis (store)
173+
REDIS_HOST=localhost

examples/commands/stores.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Symfony\AI\Store\Bridge\Neo4j\Store as Neo4jStore;
2525
use Symfony\AI\Store\Bridge\Postgres\Store as PostgresStore;
2626
use Symfony\AI\Store\Bridge\Qdrant\Store as QdrantStore;
27+
use Symfony\AI\Store\Bridge\Redis\Store as RedisStore;
2728
use Symfony\AI\Store\Bridge\SurrealDb\Store as SurrealDbStore;
2829
use Symfony\AI\Store\Bridge\Typesense\Store as TypesenseStore;
2930
use Symfony\AI\Store\Bridge\Weaviate\Store as WeaviateStore;
@@ -88,6 +89,13 @@
8889
env('QDRANT_SERVICE_API_KEY'),
8990
'symfony',
9091
),
92+
'redis' => static fn (): RedisStore => new RedisStore(
93+
new Redis([
94+
'host' => env('REDIS_HOST'),
95+
'port' => 6379,
96+
]),
97+
'symfony'
98+
),
9199
'surrealdb' => static fn (): SurrealDbStore => new SurrealDbStore(
92100
httpClient: http_client(),
93101
endpointUrl: env('SURREALDB_HOST'),

examples/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"require": {
77
"php": ">=8.2",
88
"ext-pdo": "*",
9+
"ext-redis": "*",
910
"async-aws/bedrock-runtime": "^1.1",
1011
"codewithkyrian/chromadb-php": "^0.4.0",
1112
"codewithkyrian/transformers": "^0.6.2",

examples/rag/redis.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch;
1515
use Symfony\AI\Agent\Toolbox\Toolbox;
1616
use Symfony\AI\Fixtures\Movies;
17-
use Symfony\AI\Platform\Bridge\OpenAi\Embeddings;
1817
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
1918
use Symfony\AI\Platform\Message\Message;
2019
use Symfony\AI\Platform\Message\MessageBag;

0 commit comments

Comments
 (0)