Skip to content

Commit

Permalink
fix: char
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Nov 23, 2024
1 parent ca99c91 commit 21a8c96
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 21a8c96

Please sign in to comment.