Skip to content

🤖️ Node.js framework for instantly building GPT bot applications.

License

Notifications You must be signed in to change notification settings

samzhangjy/ObserverX

Repository files navigation

banner

Contributors Forks Stargazers Issues MIT License


Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License

About The Project

ObserverX is a bot framework bundled with various builtin features, including:

  • Dynamic database loading
  • Instant history search for bot
  • Ready-to-deploy admin panel
  • Multiple deployable platforms
  • Fully customizable

ObserverX is currently built on top of GPT-3.5 / GPT-4's function API and may support other bots in the future.

Getting Started

Follow the steps below to start a console session with the bot.

Prerequisites

  • Node.js 18.17.1 or higher

Installation

  1. Get an OpenAI API key at https://platform.openai.com/account/api-keys.
  2. Install ObserverX
    npm install @observerx/core @observerx/console @observerx/database @observerx/plugin-default
  3. Create index.js and fill in the following content:
    import PlatformConsole from '@observerx/console';
    import { addEntities, getDataSource } from '@observerx/database';
    import ObserverX from '@observerx/core';
    import pluginDefault from '@observerx/plugin-default';
    
    addEntities(...ObserverX.getDatabaseEntities());
    const dataSource = getDataSource();
    
    await dataSource.initialize();
    
    const platform = new PlatformConsole(dataSource);
    
    platform.start({
      model: 'GPT-3.5',
      parentId: 'CONSOLE',
      prompt: 'default',
      plugins: [pluginDefault],
    });
  4. Create .env in the same folder as index.js and fill in the following content:
    OPENAI_API_KEY=<your api key>
    OPENAI_BASE_PATH=<optional, remove this if you don't need to change>
     
    DATABASE_HOST=<database host>
    DATABASE_USERNAME=<database username>
    DATABASE_PASSWORD=<database password>
    DATABASE_NAME=<database name>
    DATABASE_PORT=<database port>
    Note that you must use Postgres as the database.
  5. Run index.js:
    node index.js
    ...and you're ready to go!

Roadmap

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

You can contribute to ObserverX by opening an issue or starting a pull request

License

Distributed under the MIT License. See LICENSE for more information.