Skip to content

Commit

Permalink
Rename some functions, fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Mar 19, 2024
1 parent 56eca32 commit 69c7881
Show file tree
Hide file tree
Showing 23 changed files with 140 additions and 125 deletions.
16 changes: 8 additions & 8 deletions docs/docs/classes/DatabaseAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ custom_edit_url: null

___

### countMemoriesByRoomId
### countMemories

**countMemoriesByRoomId**(`room_id`, `unique?`, `tableName?`): `Promise`\<`number`\>
**countMemories**(`room_id`, `unique?`, `tableName?`): `Promise`\<`number`\>

#### Parameters

Expand Down Expand Up @@ -198,9 +198,9 @@ ___

___

### getMemoriesByRoomId
### getMemories

**getMemoriesByRoomId**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\>
**getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\>

#### Parameters

Expand Down Expand Up @@ -327,9 +327,9 @@ ___

___

### removeAllGoalsByRoomId
### removeAllGoals

**removeAllGoalsByRoomId**(`room_id`): `Promise`\<`void`\>
**removeAllGoals**(`room_id`): `Promise`\<`void`\>

#### Parameters

Expand All @@ -343,9 +343,9 @@ ___

___

### removeAllMemoriesByRoomId
### removeAllMemories

**removeAllMemoriesByRoomId**(`room_id`, `tableName`): `Promise`\<`void`\>
**removeAllMemories**(`room_id`, `tableName`): `Promise`\<`void`\>

#### Parameters

Expand Down
12 changes: 6 additions & 6 deletions docs/docs/classes/MemoryManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ A Promise resolving to the memory object, potentially updated with an embedding

___

### countMemoriesByRoomId
### countMemories

**countMemoriesByRoomId**(`room_id`, `unique?`): `Promise`\<`number`\>
**countMemories**(`room_id`, `unique?`): `Promise`\<`number`\>

Counts the number of memories associated with a set of user IDs, with an option for uniqueness.

Expand Down Expand Up @@ -108,9 +108,9 @@ A Promise that resolves when the operation completes.

___

### getMemoriesByRoomId
### getMemories

**getMemoriesByRoomId**(`opts`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\>
**getMemories**(`opts`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\>

Retrieves a list of memories by user IDs, with optional deduplication.

Expand Down Expand Up @@ -147,9 +147,9 @@ ___

___

### removeAllMemoriesByRoomId
### removeAllMemories

**removeAllMemoriesByRoomId**(`room_id`): `Promise`\<`void`\>
**removeAllMemories**(`room_id`): `Promise`\<`void`\>

Removes all memories associated with a set of user IDs.

Expand Down
24 changes: 12 additions & 12 deletions docs/docs/classes/SqliteDatabaseAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ custom_edit_url: null

___

### countMemoriesByRoomId
### countMemories

**countMemoriesByRoomId**(`room_id`, `unique?`, `tableName?`): `Promise`\<`number`\>
**countMemories**(`room_id`, `unique?`, `tableName?`): `Promise`\<`number`\>

#### Parameters

Expand All @@ -73,7 +73,7 @@ ___

#### Overrides

[DatabaseAdapter](DatabaseAdapter.md).[countMemoriesByRoomId](DatabaseAdapter.md#countmemoriesbyroomid)
[DatabaseAdapter](DatabaseAdapter.md).[countMemories](DatabaseAdapter.md#countmemoriesbyroomid)

___

Expand Down Expand Up @@ -246,9 +246,9 @@ ___

___

### getMemoriesByRoomId
### getMemories

**getMemoriesByRoomId**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\>
**getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\>

#### Parameters

Expand All @@ -266,7 +266,7 @@ ___

#### Overrides

[DatabaseAdapter](DatabaseAdapter.md).[getMemoriesByRoomId](DatabaseAdapter.md#getmemoriesbyroomid)
[DatabaseAdapter](DatabaseAdapter.md).[getMemories](DatabaseAdapter.md#getmemoriesbyroomid)

___

Expand Down Expand Up @@ -403,9 +403,9 @@ ___

___

### removeAllGoalsByRoomId
### removeAllGoals

**removeAllGoalsByRoomId**(`room_id`): `Promise`\<`void`\>
**removeAllGoals**(`room_id`): `Promise`\<`void`\>

#### Parameters

Expand All @@ -419,13 +419,13 @@ ___

#### Overrides

[DatabaseAdapter](DatabaseAdapter.md).[removeAllGoalsByRoomId](DatabaseAdapter.md#removeallgoalsbyroomid)
[DatabaseAdapter](DatabaseAdapter.md).[removeAllGoals](DatabaseAdapter.md#removeallgoalsbyroomid)

___

### removeAllMemoriesByRoomId
### removeAllMemories

**removeAllMemoriesByRoomId**(`room_id`, `tableName`): `Promise`\<`void`\>
**removeAllMemories**(`room_id`, `tableName`): `Promise`\<`void`\>

#### Parameters

Expand All @@ -440,7 +440,7 @@ ___

#### Overrides

[DatabaseAdapter](DatabaseAdapter.md).[removeAllMemoriesByRoomId](DatabaseAdapter.md#removeallmemoriesbyroomid)
[DatabaseAdapter](DatabaseAdapter.md).[removeAllMemories](DatabaseAdapter.md#removeallmemoriesbyroomid)

___

Expand Down
24 changes: 12 additions & 12 deletions docs/docs/classes/SupabaseDatabaseAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ custom_edit_url: null

___

### countMemoriesByRoomId
### countMemories

**countMemoriesByRoomId**(`room_id`, `unique?`, `tableName`): `Promise`\<`number`\>
**countMemories**(`room_id`, `unique?`, `tableName`): `Promise`\<`number`\>

#### Parameters

Expand All @@ -74,7 +74,7 @@ ___

#### Overrides

[DatabaseAdapter](DatabaseAdapter.md).[countMemoriesByRoomId](DatabaseAdapter.md#countmemoriesbyroomid)
[DatabaseAdapter](DatabaseAdapter.md).[countMemories](DatabaseAdapter.md#countmemoriesbyroomid)

___

Expand Down Expand Up @@ -247,9 +247,9 @@ ___

___

### getMemoriesByRoomId
### getMemories

**getMemoriesByRoomId**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\>
**getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\>

#### Parameters

Expand All @@ -267,7 +267,7 @@ ___

#### Overrides

[DatabaseAdapter](DatabaseAdapter.md).[getMemoriesByRoomId](DatabaseAdapter.md#getmemoriesbyroomid)
[DatabaseAdapter](DatabaseAdapter.md).[getMemories](DatabaseAdapter.md#getmemoriesbyroomid)

___

Expand Down Expand Up @@ -404,9 +404,9 @@ ___

___

### removeAllGoalsByRoomId
### removeAllGoals

**removeAllGoalsByRoomId**(`room_id`): `Promise`\<`void`\>
**removeAllGoals**(`room_id`): `Promise`\<`void`\>

#### Parameters

Expand All @@ -420,13 +420,13 @@ ___

#### Overrides

[DatabaseAdapter](DatabaseAdapter.md).[removeAllGoalsByRoomId](DatabaseAdapter.md#removeallgoalsbyroomid)
[DatabaseAdapter](DatabaseAdapter.md).[removeAllGoals](DatabaseAdapter.md#removeallgoalsbyroomid)

___

### removeAllMemoriesByRoomId
### removeAllMemories

**removeAllMemoriesByRoomId**(`room_id`, `tableName`): `Promise`\<`void`\>
**removeAllMemories**(`room_id`, `tableName`): `Promise`\<`void`\>

#### Parameters

Expand All @@ -441,7 +441,7 @@ ___

#### Overrides

[DatabaseAdapter](DatabaseAdapter.md).[removeAllMemoriesByRoomId](DatabaseAdapter.md#removeallmemoriesbyroomid)
[DatabaseAdapter](DatabaseAdapter.md).[removeAllMemories](DatabaseAdapter.md#removeallmemoriesbyroomid)

___

Expand Down
2 changes: 1 addition & 1 deletion scripts/concat.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { fileURLToPath } from 'url'
const instructions = 'The above code was taken from my codebase at https://github.com/jointhealliance/bgent.'

// Patterns to ignore
const ignorePatterns = ["evaluator", "action", "utils", "types", "memory", "constants", "messages", "agents", "relationships", "context", "provider", "logger"]
const ignorePatterns = ["evaluator", "action", "utils", "test", "types", "constants", "messages", "agents", "relationships", "context", "provider", "logger"]

// __dirname is not defined in ES module scope, so we need to create it
const __filename = fileURLToPath(import.meta.url)
Expand Down
4 changes: 2 additions & 2 deletions src/lib/__tests__/actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ describe("Actions", () => {
});

async function cleanup() {
await runtime.factManager.removeAllMemoriesByRoomId(room_id);
await runtime.messageManager.removeAllMemoriesByRoomId(room_id);
await runtime.factManager.removeAllMemories(room_id);
await runtime.messageManager.removeAllMemories(room_id);
}

// Test that actions are being loaded into context properly
Expand Down
6 changes: 3 additions & 3 deletions src/lib/__tests__/goals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ describe("Goals", () => {
});
runtime = result.runtime;
user = result.session.user;
await runtime.databaseAdapter.removeAllGoalsByRoomId(zeroUuid);
await runtime.databaseAdapter.removeAllGoals(zeroUuid);
});

beforeEach(async () => {
await runtime.databaseAdapter.removeAllGoalsByRoomId(zeroUuid);
await runtime.databaseAdapter.removeAllGoals(zeroUuid);
});

afterAll(async () => {
await runtime.databaseAdapter.removeAllGoalsByRoomId(zeroUuid);
await runtime.databaseAdapter.removeAllGoals(zeroUuid);
});

test("createGoal - successfully creates a new goal", async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/__tests__/lore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ describe("Lore", () => {
});

beforeEach(async () => {
await runtime.loreManager.removeAllMemoriesByRoomId(room_id);
await runtime.loreManager.removeAllMemories(room_id);
});

afterAll(async () => {
await runtime.loreManager.removeAllMemoriesByRoomId(room_id);
await runtime.loreManager.removeAllMemories(room_id);
});

test("Add and get lore", async () => {
Expand Down
Loading

0 comments on commit 69c7881

Please sign in to comment.