Skip to content

emcd/ai-experiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contains an application to interact with various AI providers, plus some utilities to scrape data from the web and ingest into vector databases.

Use

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

Installation

Initial Installation

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:

  1. Ensure that you have installed Git LFS.
  2. Clone this repository.
  3. 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....)
  4. Ensure that you have installed Hatch via Pipx:
    pipx install hatch
    

Installation Updates

  1. Run:
    git pull
    
  2. 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.

Configuration

General

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

Environment variables are loaded from one of the following files:

  1. An .env file in your current working directory.
  2. An .env file in the same directory as this README.
  3. The location from the environment-file entry in the general configuration (see above). By default, this is a file, named environment, 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.

AI Providers

OpenAI

  1. Add your OpenAI API key to the environment file as follows:
    OPENAI_API_KEY=<your OpenAI API key>
    
  2. If you have an OpenAI organization ID, you can add it to the environment file:
    OPENAI_ORG_ID=<your organization ID>
    
  3. If you have an OpenAI project ID, you can add it to the environment file:
    OPENAI_PROJECT_ID=<your project ID>
    

Development

If you intend to develop on this project (i.e., enhance the library, rather than simply use it), then please consider the following suggestions.

Installation

  1. Install Git pre-commit and pre-push hooks:
    hatch --env develop run pre-commit install --config .auxiliary/configuration/pre-commit.yaml
    
    and validate the installation with:
    hatch --env develop run pre-commit run --config .auxiliary/configuration/pre-commit.yaml --all-files
    

Editor Environment

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages