forked from ai16z/eliza
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fec2d59
commit f1b4743
Showing
5 changed files
with
92 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,28 +38,28 @@ export async function createRuntime({ | |
|
||
switch (env?.TEST_DATABASE_CLIENT as string) { | ||
case "sqljs": | ||
{ | ||
const module = await import("sql.js"); | ||
|
||
const initSqlJs = module.default; | ||
|
||
// SQLite adapter | ||
const SQL = await initSqlJs({}); | ||
const db = new SQL.Database(); | ||
|
||
adapter = new SqlJsDatabaseAdapter(db); | ||
|
||
// Load sqlite-vss | ||
loadVecExtensions((adapter as SqlJsDatabaseAdapter).db); | ||
// Create a test user and session | ||
session = { | ||
user: { | ||
id: zeroUuid, | ||
email: "[email protected]", | ||
}, | ||
}; | ||
} | ||
break; | ||
{ | ||
const module = await import("sql.js"); | ||
|
||
const initSqlJs = module.default; | ||
|
||
// SQLite adapter | ||
const SQL = await initSqlJs({}); | ||
const db = new SQL.Database(); | ||
|
||
adapter = new SqlJsDatabaseAdapter(db); | ||
|
||
// Load sqlite-vss | ||
loadVecExtensions((adapter as SqlJsDatabaseAdapter).db); | ||
// Create a test user and session | ||
session = { | ||
user: { | ||
id: zeroUuid, | ||
email: "[email protected]", | ||
}, | ||
}; | ||
} | ||
break; | ||
case "supabase": { | ||
const module = await import("@supabase/supabase-js"); | ||
|
||
|
@@ -108,25 +108,25 @@ export async function createRuntime({ | |
} | ||
case "sqlite": | ||
default: | ||
{ | ||
const module = await import("better-sqlite3"); | ||
|
||
const Database = module.default; | ||
|
||
// SQLite adapter | ||
adapter = new SqliteDatabaseAdapter(new Database(":memory:")); | ||
|
||
// Load sqlite-vss | ||
await loadVecExtensions((adapter as SqliteDatabaseAdapter).db); | ||
// Create a test user and session | ||
session = { | ||
user: { | ||
id: zeroUuid, | ||
email: "[email protected]", | ||
}, | ||
}; | ||
} | ||
break; | ||
{ | ||
const module = await import("better-sqlite3"); | ||
|
||
const Database = module.default; | ||
|
||
// SQLite adapter | ||
adapter = new SqliteDatabaseAdapter(new Database(":memory:")); | ||
|
||
// Load sqlite-vss | ||
await loadVecExtensions((adapter as SqliteDatabaseAdapter).db); | ||
// Create a test user and session | ||
session = { | ||
user: { | ||
id: zeroUuid, | ||
email: "[email protected]", | ||
}, | ||
}; | ||
} | ||
break; | ||
} | ||
|
||
const runtime = new AgentRuntime({ | ||
|