Skip to content

A web app providing a quick generative AI pipeline prototyping

License

Notifications You must be signed in to change notification settings

LioQing/chat-conductor

Repository files navigation

Chat Conductor

Chat conductor project. This is a project aimed at providing a quick generative AI pipeline prototyping.

The backend of this project is Chat Composer.

Demo Video

2024-01-25.19-19-15_1.mp4

Current Features

User feature:

  • Create containerized pipeline project
  • Call supported generative AI services (currently support Azure OpenAI Chat Completion, Google Vertex AI Gemini Pro)
  • Download project files
  • Integrate Chat Conductor API into your own project

Admin feature:

  • Create and whitelist user
  • Monitor user token usage on supported generative AI services

Environment Setup

Node.js and npm

We use Node.js 18.17 and npm 9.6, so make sure you have that installed.

You could use nvm or nvm-windows (Windows is not recommended to install pyenv because it does not get native support) to manage your Node.js and npm versions.

Install the Node.js version you want to use, which also installs the npm.

nvm install <version>

Specify the version for you are going to use.

nvm use <version>

To check your Node.js and npm version, run node --version and npm --version respectively in your terminal.

node --version
npm --version

Environment Variables

Make a copy of the .env.example file and rename it to .env.

cp .env.example .env

Fill in the environment variables in the .env file.

Install Dependencies

Install the dependencies for the project.

npm install

Lint and Pre-commit

We use Prettier and ESLint for the coding style and guidelines. The style is then enforced by Husky and lint-staged.

Finish the environment setup above (especially installing the dependencies with npm) before proceeding.

Install and setup the pre-commit hooks.

npm run pre-commit
chmod +x .husky/pre-commit

To run linting manually (only scans staged files).

npx lint-staged

Remember to stage files again if there are any changes made by the pre-commit hooks or by you.

git add .

VS Code Settings

You can add a workspace setting to automatically format your code on save using the black formatter.

You need to have the Prettier - Code formatter and Prettier ESLint extensions installed.

Bring up the command palette with Ctrl+Shift+P(Windows/Linux) / Cmd+Shift+P(Mac) and search for "Preferences: Open Workspace Settings (JSON)".

Then replace the content with the following:

{
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "[javascript][typescript][javascriptreact][typescriptreact][json][css][html]": {
    "editor.tabSize": 2
  }
}

Development

Clone Repository

First clone the repository.

git clone git@github.com:<username>/<repository>.git

Important: You may need to setup SSH keys for your GitHub account. See this guide for more information.

Checkout Branch

Then checkout the branch you want to work on.

git checkout <branch>

Committing Changes

Commit your changes to the branch you are working on.

git add .
git commit -m "Your commit message"

Make any changes and stage your files again according to the pre-commit hooks.

Pushing Changes

Set your branch's upstream branch to be the same branch on the remote repository on GitHub.

git push -u origin <branch>

After the first time you set the upstream branch, you can simply push without specifying the branch.

git push

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

About

A web app providing a quick generative AI pipeline prototyping

Resources

License

Stars

Watchers

Forks

Languages