Skip to content

Commit

Permalink
improve goals, add build
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Mar 4, 2024
1 parent 2a3e85b commit c9bfe51
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2

- run: npm ci
- run: npm run build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A flexible, scalable and customizable agent for production apps. Comes with batt
![cj](https://github.com/jointhealliance/bgent/assets/18633264/7513b5a6-2352-45f3-8b87-7ee0e2171a30)

[![npm version](https://badge.fury.io/js/bgent.svg)](https://badge.fury.io/js/bgent)
![build passing](https://github.com/JoinTheAlliance/bgent/actions/workflows/deploy_worker.yaml/badge.svg)
![build passing](https://github.com/JoinTheAlliance/bgent/actions/workflows/build.yaml/badge.svg)
![tests passing](https://github.com/JoinTheAlliance/bgent/actions/workflows/test.yaml/badge.svg)
![lint passing](https://github.com/JoinTheAlliance/bgent/actions/workflows/lint.yaml/badge.svg)
[![License](https://img.shields.io/badge/License-MIT-blue)](https://github.com/jointhealliance/bgent/blob/main/LICENSE)
Expand Down
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.25",
"version": "0.0.26",
"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/jointhealliance/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 = ['test/', 'flavor', 'relationships', 'goals', 'evaluators', 'memory', 'providers', 'messages', 'lore', 'context', 'simple', 'cache', 'supabase', 'utils', 'logger', 'index', 'data', 'constants', 'templates', 'worker']
const ignorePatterns = ['test/', 'flavor', 'simple', 'cache', '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
12 changes: 9 additions & 3 deletions src/lib/actions/wait.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ export default {
[
{
user: "{{user1}}",
content:
"Discovered a new dollar store downtown. It's seriously a hidden gem.",
content: {
content:
"Discovered a new dollar store downtown. It's seriously a hidden gem.",
action: "WAIT",
},
},
{
user: "{{user2}}",
Expand All @@ -117,7 +120,10 @@ export default {
},
{
user: "{{user1}}",
content: { content: "They sell espresso for a dollar." },
content: {
content: "They sell espresso for a dollar.",
action: "WAIT",
},
},
{
user: "{{user2}}",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ export const composeContext = ({
return out;
};

export const addHeader = (header: string, context: string) => {
return context.length > 0 ? `${header}\n${context}` : "";
export const addHeader = (header: string, body: string) => {
return body.length > 0 ? `${header ? header + "\n" : header}${body}\n` : "";
};
6 changes: 5 additions & 1 deletion src/lib/evaluators/goal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ async function handler(
.map((goal: Goal) => {
const update = updates?.find((u) => u.id === goal.id);
if (update) {
return { ...goal, ...update }; // Merging the update into the existing goal
return {
...goal,
...update,
objectives: { ...goal.objectives, ...update.objectives },
}; // Merging the update into the existing goal
}
return null; // No update for this goal
})
Expand Down

0 comments on commit c9bfe51

Please sign in to comment.