Skip to content

Commit

Permalink
Remove redis cache from repo and update
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Feb 6, 2025
1 parent c00852f commit 4a37bb0
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 383 deletions.
1 change: 0 additions & 1 deletion agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"exec": "node --enable-source-maps --loader ts-node/esm src/index.ts"
},
"dependencies": {
"@elizaos/cache-redis": "workspace:*",
"@elizaos/client-direct": "workspace:*",
"@elizaos/plugin-bootstrap": "workspace:*",
"@elizaos/core": "workspace:*",
Expand Down
32 changes: 16 additions & 16 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import { PGLiteDatabaseAdapter } from "@elizaos/adapter-pglite";
// import { PostgresDatabaseAdapter } from "@elizaos/adapter-postgres";
// import { QdrantDatabaseAdapter } from "@elizaos/adapter-qdrant";
import { RedisClient } from "@elizaos/cache-redis";
// import { RedisClient } from "@elizaos/cache-redis";
// import { SqliteDatabaseAdapter } from "@elizaos/adapter-sqlite";
// import { SupabaseDatabaseAdapter } from "@elizaos/adapter-supabase";
// import { AutoClientInterface } from "@elizaos/client-auto";
Expand Down Expand Up @@ -1050,21 +1050,21 @@ function initializeCache(
db?: IDatabaseCacheAdapter
) {
switch (cacheStore) {
case CacheStore.REDIS:
if (process.env.REDIS_URL) {
elizaLogger.info("Connecting to Redis...");
const redisClient = new RedisClient(process.env.REDIS_URL);
if (!character?.id) {
throw new Error(
"CacheStore.REDIS requires id to be set in character definition"
);
}
return new CacheManager(
new DbCacheAdapter(redisClient, character.id) // Using DbCacheAdapter since RedisClient also implements IDatabaseCacheAdapter
);
} else {
throw new Error("REDIS_URL environment variable is not set.");
}
// case CacheStore.REDIS:
// if (process.env.REDIS_URL) {
// elizaLogger.info("Connecting to Redis...");
// const redisClient = new RedisClient(process.env.REDIS_URL);
// if (!character?.id) {
// throw new Error(
// "CacheStore.REDIS requires id to be set in character definition"
// );
// }
// return new CacheManager(
// new DbCacheAdapter(redisClient, character.id) // Using DbCacheAdapter since RedisClient also implements IDatabaseCacheAdapter
// );
// } else {
// throw new Error("REDIS_URL environment variable is not set.");
// }

case CacheStore.DATABASE:
if (db) {
Expand Down
6 changes: 0 additions & 6 deletions packages/cache-redis/.npmignore

This file was deleted.

183 changes: 0 additions & 183 deletions packages/cache-redis/__tests__/redis-adapter.test.ts

This file was deleted.

39 changes: 0 additions & 39 deletions packages/cache-redis/package.json

This file was deleted.

76 changes: 0 additions & 76 deletions packages/cache-redis/src/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/cache-redis/tsconfig.json

This file was deleted.

21 changes: 0 additions & 21 deletions packages/cache-redis/tsup.config.ts

This file was deleted.

Loading

0 comments on commit 4a37bb0

Please sign in to comment.