From 21a8c961c27c0e4105f9506d3f16563f57e2dae2 Mon Sep 17 00:00:00 2001 From: ponderingdemocritus Date: Sat, 23 Nov 2024 13:49:07 +1100 Subject: [PATCH] fix: char --- agent/src/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/agent/src/index.ts b/agent/src/index.ts index 6e7ca7486b0..1d8f1c0817f 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -32,7 +32,7 @@ import readline from "readline"; import yargs from "yargs"; import path from "path"; import { fileURLToPath } from "url"; -import blobert from "./blobert.ts"; +import { character } from "./character.ts"; import type { DirectClient } from "@ai16z/client-direct"; const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file @@ -263,6 +263,13 @@ export function createAgent( }); } +function intializeFsCache(baseDir: string, character: Character) { + const cacheDir = path.resolve(baseDir, character.id, "cache"); + + const cache = new CacheManager(new FsCacheAdapter(cacheDir)); + return cache; +} + function intializeDbCache(character: Character, db: IDatabaseCacheAdapter) { const cache = new CacheManager(new DbCacheAdapter(db, character.id)); return cache; @@ -310,7 +317,7 @@ const startAgents = async () => { let charactersArg = args.characters || args.character; - let characters = [blobert]; + let characters = [character]; if (charactersArg) { characters = await loadCharacters(charactersArg);