Coder Social home page Coder Social logo

ai-dsl's Introduction

BabyAGI JS

BabyAGI JS is a JavaScript-based AI agent that creates, prioritizes, and executes tasks using the GPT 3.5 or GPT 4 architecture. It integrates with OpenAI's language model to create a powerful AI that can handle a wide range of tasks.

Features

  • Task creation: Generates new tasks based on the current context and objectives.
  • Task prioritization: Reorders tasks according to their importance and relevance to the main objective.
  • Task execution: Performs tasks and returns results.

How to use

  1. Clone this repository.
  2. Add API keys to your .env
OPENAI_API_KEY=
  1. Install the required dependencies using npm install.
  2. Write your code in the src directory.
  3. Run your program with npm run start.

Main Files

src/index.ts

This file initializes the BabyAGI agent with the required configurations, including the language model and objective. It imports the BabyAGI class from babyagi.js and creates a new instance to perform tasks based on the given objective.

src/babyagi.ts

This file contains the core implementation of the BabyAGI agent. It defines three main classes, TaskCreationChain, TaskPrioritizationChain, and ExecutionChain, which are responsible for creating, prioritizing, and executing tasks, respectively.

The BabyAGI class combines these three classes and provides methods to add tasks, print tasks, and execute tasks. The call method is the main entry point to start the agent's task processing loop.

Example

The following is an example of how to use the BabyAGI agent:

  1. Set the objective in src/index.ts:
const OBJECTIVE = 'Integrate stripe in typescript';
  1. Run the program with npm run start.
  2. The BabyAGI agent will create, prioritize, and execute tasks based on the given objective.

Contributing

We welcome contributions to improve BabyAGI JS. Feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

ai-dsl's People

Contributors

ericciarla avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.