Skip to content

Commit

Permalink
0.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Feb 21, 2024
1 parent 70ab058 commit e8ecc0e
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bgent",
"version": "0.0.12",
"version": "0.0.13",
"private": false,
"description": "bgent. because agent was taken.",
"type": "module",
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/lalalune/bgent. You are writing tests and documentation for my codebase. Please use the above code as a reference. Tests should be written with Jest and Typescript. Do not use mocks or stubs. Keep it very simple and straightforward.'

// Patterns to ignore
const ignorePatterns = ['actionExamples.ts', 'agents', 'goal', 'cache', 'goals', 'supabase', 'utils', 'logger', 'index', 'data', 'constants', 'templates', 'worker']
const ignorePatterns = ['actionExamples.ts', 'tests', 'test', 'agents', 'goal', 'cache', 'goals', 'supabase', 'utils', 'logger', 'index', 'data', 'constants', 'templates', 'worker']

// __dirname is not defined in ES module scope, so we need to create it
const __filename = fileURLToPath(import.meta.url)
Expand Down
2 changes: 1 addition & 1 deletion src/agents/cj/evaluators/__tests__/profile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe("User Profile", () => {

expect(
result.toLowerCase().includes("startup") ||
result.toLowerCase().includes("programmer"),
result.toLowerCase().includes("programmer"),
).toBe(true);

const descriptions = await runtime.descriptionManager.getMemoriesByIds({
Expand Down
3 changes: 3 additions & 0 deletions src/lib/actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { default as wait } from "./wait";
export { default as ignore } from "./ignore";
export { default as continue } from "./continue";
1 change: 1 addition & 0 deletions src/lib/evaluators/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as summarization } from "./summarization";
2 changes: 2 additions & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export * from "./actions";
export * from "./actions/index";
export * from "./context";
export * from "./evaluation";
export * from "./evaluators/index";
export * from "./goals";
export * from "./logger";
export * from "./memory";
Expand Down
9 changes: 8 additions & 1 deletion src/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,21 @@ export class BgentRuntime {
}

async handleRequest(message: Message, state?: State) {
console.log("handleRequest", message, state);
await this.saveRequestMessage(message, state as State);

console.log("handleRequest", message, state);
if (!state) {
state = (await this.composeState(message)) as State;
}
console.log("handleRequest", message, state);

const context = composeContext({
state,
template: requestHandlerTemplate,
});

console.log("context", context);

if (this.debugMode) {
logger.log(context, {
title: "Response Context",
Expand All @@ -224,11 +228,14 @@ export class BgentRuntime {
const { senderId, room_id, userIds: user_ids, agentId } = message;

for (let triesLeft = 3; triesLeft > 0; triesLeft--) {
console.log("triesLeft", triesLeft);
const response = await this.completion({
context,
stop: [],
});

console.log("response", response);

this.supabase
.from("logs")
.insert({
Expand Down
1 change: 0 additions & 1 deletion src/test/testEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ export const TEST_EVALUATOR_FAIL = {
},
],
} as Evaluator;

3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
},
"include": [
"src",
"__tests__",
"jest.config.js",
"rollup.config.js",
],
"exclude": [
"node_modules",
Expand Down

0 comments on commit e8ecc0e

Please sign in to comment.