Contains an application to interact with various AI providers, plus some utilities to scrape data from the web and ingest into vector databases.
NOTE: Please read the installation and configuration instructions before use.
Currently, there is no installable package, but you can run the application via Hatch:
hatch run aiwb
Currently, there is no installable package. But, the application can be setup to run from a virtual environment without too much hassle by following these steps:
- Ensure that you have installed Git LFS.
- Clone this repository.
- Ensure that you have installed
Pipx.
(If installing via
pip
, you will want to use your system Python rather than the current global Python provided by Asdf, Mise, Pyenv, etc....) - Ensure that you have installed
Hatch via Pipx:
pipx install hatch
- Run:
git pull
- Remove possibly-stale virtual environments:
hatch env prune
The default
virtual environment will be automatically rebuilt next time the
application is run via Hatch. You may need to run something in the develop
virtual environment to rebuild it too, if you have installed Git hooks which
rely upon it.
A file, named general.toml
, located in the user configuration directory for
the application, on first run. The user configuration directory varies by
platform:
- MacOS:
- Windows:
- XDG (Linux distributions, etc...):
~/.config/aiwb
This file includes configurations for your AI providers, switches to enable or disable special functionality, and the locations where your environment, prompts, and conversations are stored.
Environment variables are loaded from one of the following files:
- An
.env
file in your current working directory. - An
.env
file in the same directory as this README. - The location from the
environment-file
entry in the general configuration (see above). By default, this is a file, namedenvironment
, in the user configuration directory. The files are considered in the above order and only the first that exists is a source for environment variables. The remainder are ignored.
Warning: If you keep your home directory, or pieces of it, in version control,
and you have an environment file in the user configuration directory for the
application, then you probably want to add the file location to .gitignore
,
or equivalent, to avoid exposing sensitive credentials.
- Add your OpenAI API key to the environment file as follows:
OPENAI_API_KEY=<your OpenAI API key>
- If you have an OpenAI organization ID, you can add it to the environment
file:
OPENAI_ORG_ID=<your organization ID>
- If you have an OpenAI project ID, you can add it to the environment file:
OPENAI_PROJECT_ID=<your project ID>
If you intend to develop on this project (i.e., enhance the library, rather than simply use it), then please consider the following suggestions.
- Install Git pre-commit and pre-push hooks:
and validate the installation with:
hatch --env develop run pre-commit install --config .auxiliary/configuration/pre-commit.yaml
hatch --env develop run pre-commit run --config .auxiliary/configuration/pre-commit.yaml --all-files
You may want to run your editor from inside a Hatch-prepared shell environment to ensure that any online linters or language servers have access to the correct set of Python packages:
hatch --env develop shell