#JS Agent

52 messages · Page 1 of 1 (latest)

fierce drum
#

GPTAgent.js is a composable and extensible framework for creating AI agents with TypeScript/JavaScript.

Creating AI agents requires a lot of experimentation. GPTAgent.js makes the agent configuration explicit, so you can easily understand and adjust what the agent is doing.

sudden cedar
#

thanks
i am gonna test that

fierce drum
#

Cool! lmk if you have questions or run into thing that it doesn't support yet!

fierce drum
fierce drum
sudden cedar
#

i tried to build and run , but got an error , i used esbuild:

#
 {
    "build": "esbuild  --bundle --format=cjs --platform=node main.js --outdir=build"
 }
fierce drum
fierce drum
#

Wondering what could be different in your vs my setup that would cause esbuild to fail

sudden cedar
#

did you run it ?

fierce drum
#

ah - now I have the same issue

#

it's an esbuild import issue (see https://github.com/evanw/esbuild/issues/17 ).

Try

import * as $ from "@gptagent/agent";
import { ActionRegistry, Agent, runCLIAgent } from "@gptagent/agent";

for importing on top of main js. That fixed it for me (with gptagent.js 0.0.4 and the corresponding example from 0.0.4)

sudden cedar
#

when i get free time, i will check it more .

fierce drum
#

The example needs to match the gptagent.js version, right now it's evolving a lot and the API breaks between versions. Updating to the latest example from the website might fix it.

fierce drum
#

^ v0.0.5 changes the agent structure slightly (code might need to be updated)

warm anchor
#

@fierce drum i see the example of js developer, would that work if i have a large js/ts file that is way over the token limit?

fierce drum
warm anchor
#

ok, human beings last job: decouple/refactor large single file into multiple meaningful files 😉

#

i am going to put a eslint rule in our project to limit them producing files greater than the limit of openAPI token 😉

fierce drum
#

AI's like good, well structured codebases.

#

Would be hilarious to see an ESLint rule set to make codebases better for AI

warm anchor
#

i am on golang these days and i can't remember too much details about ts/js. in go, i can just decouple things into multiple files as long as they are under the same package. i bet i can do similar with ts

// index.ts
export * from './func_group1'
export * from './func_group2'
...
export * from './func_group9999'

🧌

fierce drum
#

Lol yeah, those index files... one of the things i like about gptagent.js is that it can write/update them.

warm anchor
#

i am going to give it try. I am thinking about let it write some cypress e2e test and i can let the manual testers go ... they don't produce much and my devs hate writing e2e ui test cause it take a lot of time 😦

fierce drum
#

Cool, let me know how it goes - the task seems ambitious for the current state of things. Doing E2E testing (and maybe even automated exploratory UI testing) with agents is very exciting!

fierce drum
fierce drum
carmine current
#

Looks pretty awesome, good work!

fierce drum
fierce drum
fierce drum
#

JS Agent

fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
fierce drum
#

JS Agent v0.0.21 released:

  • Tiktoken tokenizer which supports the 'cl100k_base' encoding that is used by gpt-4, gpt-3.5-turbo and text-embedding-ada-002 (using the great JS implementation by @__dqbd )
  • Restructured provider package into api, cost, model, and tokenizer
  • API…
fierce drum