Skip to content

Commit

Permalink
clean logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Mar 19, 2024
1 parent 69c7881 commit 8959759
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 39 deletions.
1 change: 0 additions & 1 deletion src/lib/__tests__/evaluation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe("Evaluation Process", () => {
}

room_id = data!.room_id;
console.log("Room ID", room_id);
});

test("Validate the format of the examples from the evaluator", () => {
Expand Down
2 changes: 0 additions & 2 deletions src/lib/__tests__/messages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ describe("Messages Library", () => {
userB,
});

console.log("relationship", relationship);

if (!relationship?.room_id) {
throw new Error("Room not found");
}
Expand Down
17 changes: 6 additions & 11 deletions src/lib/__tests__/relationships.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,15 @@ describe("Relationships Module", () => {
});

test("createRelationship creates a new relationship", async () => {
console.log("user: ", user);
const userA = user.id as UUID;
const userB = zeroUuid;
if (userA === undefined) throw new Error("userA is undefined");
try {
const relationship = await createRelationship({
runtime,
userA,
userB,
});
expect(relationship).toBe(true);
} catch (error) {
console.log("*** error: ", error);
}
const relationship = await createRelationship({
runtime,
userA,
userB,
});
expect(relationship).toBe(true);
});

test("getRelationship retrieves an existing relationship", async () => {
Expand Down
30 changes: 16 additions & 14 deletions src/lib/actions/__tests__/elaborate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ describe("User Profile", () => {
userB: zeroUuid,
});

console.log("data", data);

if (!data) {
throw new Error("Relationship not found");
}
Expand All @@ -76,8 +74,6 @@ describe("User Profile", () => {
zeroUuid,
]);

console.log("rooms", rooms)

if (!rooms || rooms.length === 0) {
throw new Error("Room not found");
}
Expand Down Expand Up @@ -164,15 +160,17 @@ describe("User Profile", () => {
room_id: room_id,
};

console.log("room_id", room_id);

const initialMessageCount =
await runtime.messageManager.countMemories(room_id, false);
const initialMessageCount = await runtime.messageManager.countMemories(
room_id,
false,
);

await action.handler!(runtime, message);

const finalMessageCount =
await runtime.messageManager.countMemories(room_id, false);
const finalMessageCount = await runtime.messageManager.countMemories(
room_id,
false,
);

const agentMessages = await runtime.messageManager.getMemories({
room_id,
Expand Down Expand Up @@ -213,13 +211,17 @@ describe("User Profile", () => {
room_id: room_id as UUID,
};

const initialMessageCount =
await runtime.messageManager.countMemories(room_id, false);
const initialMessageCount = await runtime.messageManager.countMemories(
room_id,
false,
);

await action.handler!(runtime, message);

const finalMessageCount =
await runtime.messageManager.countMemories(room_id, false);
const finalMessageCount = await runtime.messageManager.countMemories(
room_id,
false,
);

return finalMessageCount - initialMessageCount === 2;
});
Expand Down
10 changes: 1 addition & 9 deletions src/lib/adapters/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,6 @@ export class SqliteDatabaseAdapter extends DatabaseAdapter {

const memories = this.db.prepare(sql).all(...queryParams) as Memory[];

console.log("params", params);
console.log("sql", sql);
console.log("queryParams", queryParams);
console.log("memories", memories);

return memories.map((memory) => ({
...memory,
content: JSON.parse(memory.content as unknown as string),
Expand Down Expand Up @@ -248,10 +243,7 @@ export class SqliteDatabaseAdapter extends DatabaseAdapter {
this.db.prepare(sql).run(tableName, memoryId);
}

async removeAllMemories(
room_id: UUID,
tableName: string,
): Promise<void> {
async removeAllMemories(room_id: UUID, tableName: string): Promise<void> {
const sql = `DELETE FROM memories WHERE type = ? AND room_id = ?`;
this.db.prepare(sql).run(tableName, room_id);
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/getOrCreateRelationship.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export async function getOrCreateRelationship({
}

if (!relationship) {
console.log("**** roomId", roomId);

// Create the relationship
await runtime.databaseAdapter.createRelationship({
userA,
Expand Down

0 comments on commit 8959759

Please sign in to comment.