Giter Site home page Giter Site logo

jerome-white / open-chat-studio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dimagi/open-chat-studio

0.0 0.0 0.0 3 MB

A web based platform for building Chatbots backed by Large Language Models

License: BSD 3-Clause "New" or "Revised" License

JavaScript 0.37% Python 79.33% TypeScript 5.30% CSS 0.56% HTML 14.30% SCSS 0.01% Sass 0.13%

open-chat-studio's Introduction

Open Chat Studio

Experiments with AI, GPT and LLMs. See this wiki for more information.

Dev Environment Setup

This project uses Invoke for dev automation. You can view the list of available commands with:

inv -l

New commands / updates can be made to the tasks.py file.

1. Install dependencies

Setup a virtualenv and install requirements:

python -m venv venv
pip install -r dev-requirements.txt

Python 3.11 is recommended.

2. Run the automated setup

inv setup-dev-env

This will:

Install the pre-commit hooks

pre-commit install --install-hooks

Set up database

Start the database and redis services and run the DB migrations:

docker compose -f docker-compose.dev.yml up -d  # equivalent of `inv up`
cp .env.example .env
./manage.py migrate

Build the front-end resources

To build JavaScript and CSS files, first install npm packages:

npm install
npm run dev

Note

You should be using node >= 18.0.0. If you have nvm installed, you can run nvm use to switch to the correct version.

To check which version you are using use node --version.

Create a superuser

./manage.py createsuperuser

Running server

./manage.py runserver

Running Celery

Celery can be used to run background tasks.

Note: Celery is required to run in order to get a response from an LLM, so you'll need to run this if you want to test end-to-end conversations.

You can run it using:

celery -A gpt_playground worker -l INFO

Or with celery beat (for scheduled tasks):

celery -A gpt_playground worker -l INFO -B

Updating translations

inv translations

Updating requirements

inv requirements

Options:
  -p STRING, --upgrade-package=STRING
  -u, --upgrade-all

Installing Git commit hooks

To install the Git commit hooks run the following:

$ pre-commit install --install-hooks

Once these are installed they will be run on every commit.

Running Tests

To run tests:

pytest

Or to test a specific app/module:

pytest apps/utils/tests/test_slugs.py

Notes

Signup page

By default the signup page is disabled. To enable it, you should set the SIGNUP_ENABLED environment variable to true

Testing webhooks

To test the webhooks, you can use a tool like ngrok to forward webhook data to your local machine.

Auditing

We use the django-field-audit library for auditing. Please see the table of audited methods and familiarize yourself on how to audit "special" functions like QuerySet.bulk_create().

Linting

We use ruff for linting and formatting. You can run it directly or with the inv ruff command:

Usage: inv[oke] [--core-opts] ruff [--options] [other tasks here ...]

Docstring:
  Run ruff checks and formatting. Use --unsafe-fixes to apply unsafe fixes.

Options:
  -n, --no-fix
  -u, --unsafe-fixes

open-chat-studio's People

Contributors

snopoke avatar smittiec avatar proteusvacuum avatar bderenzi avatar stephherbers avatar czue avatar charl1996 avatar dependabot[bot] avatar ctsims 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.