Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error in getGoals and remove coinbase package-lock.json #545

Merged
merged 4 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/adapter-postgres/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,12 @@ export class PostgresDatabaseAdapter
.map((_, i) => `$${i + 3}`)
.join(", ");

let query = `SELECT * FROM memories WHERE type = $1 AND "agentId" = $2 AND "roomId" IN (${placeholders})`;
let queryParams = [params.tableName, params.agentId, ...params.roomIds];
const query = `SELECT * FROM memories WHERE type = $1 AND "agentId" = $2 AND "roomId" IN (${placeholders})`;
const queryParams = [
params.tableName,
params.agentId,
...params.roomIds,
];

const { rows } = await this.query(query, queryParams);
return rows.map((row) => ({
Expand Down Expand Up @@ -339,7 +343,7 @@ export class PostgresDatabaseAdapter
}): Promise<Memory[]> {
if (!params.tableName) throw new Error("tableName is required");
if (!params.roomId) throw new Error("roomId is required");
let sql = `SELECT * FROM memories WHERE type = $1 AND agentId = $2 AND "roomId" = $3`;
let sql = `SELECT * FROM memories WHERE type = $1 AND "agentId" = $2 AND "roomId" = $3`;
const values: any[] = [params.tableName, params.agentId, params.roomId];
let paramCount = 2;

Expand Down
3 changes: 2 additions & 1 deletion packages/adapter-postgres/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
"rootDir": "src",
"strict": true
},
"include": ["src/**/*.ts"]
}
3 changes: 2 additions & 1 deletion packages/adapter-sqlite/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
"rootDir": "src",
"strict": true
},
"include": ["src/**/*.ts"]
}
4 changes: 1 addition & 3 deletions packages/core/src/goals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@ import {
} from "./types.ts";

export const getGoals = async ({
agentId,
runtime,
roomId,
userId,
onlyInProgress = true,
count = 5,
}: {
runtime: IAgentRuntime;
agentId: UUID;
roomId: UUID;
userId?: UUID;
onlyInProgress?: boolean;
count?: number;
}) => {
return runtime.databaseAdapter.getGoals({
agentId,
agentId: runtime.agentId,
roomId,
userId,
onlyInProgress,
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,6 @@ export class AgentRuntime implements IAgentRuntime {
unique: false,
}),
getGoals({
agentId: this.agentId,
runtime: this,
count: 10,
onlyInProgress: false,
Expand Down
Loading
Loading