Skip to main content

Botwrap

A convenient wrapper for the OpenAI API, designed to provide additional functionalities and simplify integration into various applications. This package includes a core team of assistants with unique personas and tools to handle a variety of tasks.

Table of Contents

Project Overview

The Botwrap project aims to simplify the use of OpenAI's API by providing a structured approach to manage and utilize different AI assistants. Each assistant has specific capabilities and tools to perform designated tasks effectively. The project is organized into several modules, including assistants, threads, files, vector stores, and more.

Installation

  1. Clone the repository:

    git clone https://github.com/BizPrincess/botwrap.git
    cd botwrap
    
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    
  3. Install the required packages:

    pip install -r requirements.txt
    
  4. Install the package:

    pip install .
    

Usage

Example Usage

  1. Set up your environment variables: Create a .env file in the root directory of the project and add your OpenAI API key:

    OPENAI_API_KEY=your-openai-api-key
    
  2. Run the main application:

    python -m openaiwrapper.main
    

    This will initialize the package and perform various interactions with the assistants defined in the project.

Configuration

The project uses environment variables for configuration. Create a .env file in the root directory and add the following:

OPENAI_API_KEY=your-openai-api-key
LOG_FILE=application.log
API_BASE_URL=https://api.openai.com/v1
ENVIRONMENT=development  # or 'production' based on your setup

The configuration can be customized in the openaiwrapper/config.py file, which defines different settings for development and production environments.

Profiles

The project includes several predefined profiles for the core team of assistants. Each profile specifies the assistant's name, description, model, instructions, and available tools.

Core Team Profiles

  • Brie: People Operations Specialist and Humanities Expert
  • Britt: Business Strategist and Computer Science Enthusiast
  • Derek: Innovative CEO and Engineering Economist
  • Max: Strategy Analyst and Critical Thinker
  • Nate: Software Engineer and Gaming Enthusiast
  • Riley: AI Expert, Prompt Engineer & Project Manager

Profiles are stored as JSON files in the openaiwrapper/profiles directory. For example, the profile for Brie is stored in coreteam_brie.json.

Example Non-Coreteam Profile

  • Example Non-Coreteam Assistant: General-purpose assistant for various tasks.

Testing

To run the tests, you can use the unittest framework included with Python. The tests are located in the tests directory.

  1. Run all tests:

    python -m unittest discover -s tests
    
  2. Check the test coverage (optional): You can use coverage.py to check the test coverage:

    pip install coverage
    coverage run -m unittest discover -s tests
    coverage report
    

Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository
  2. Create a new branch:
    git checkout -b feature/YourFeature
    
  3. Make your changes and commit them:
    git commit -m "Add some feature"
    
  4. Push to the branch:
    git push origin feature/YourFeature
    
  5. Open a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.


Additional Notes

  • Core Team Profiles: The project includes predefined profiles for the core team of assistants. Each profile specifies the assistant's name, description, model, instructions, and available tools.
  • Logging: The project uses Python's logging module to log important information and debug messages.
  • Mocking for Tests: The tests use unittest.mock to mock external dependencies and ensure the functions are tested in isolation.
  • Task Orchestrator: The orchestrator module contains logic for orchestrating conversations with multiple assistants. This includes initializing assistants, managing conversation threads, distributing tasks, and aggregating responses.

Metadata

Release files for botwrap 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for botwrap 0.1.9
File Size Uploaded
botwrap-0.1.9.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for botwrap 0.1.9
File Interpreter ABI Platform
botwrap-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 41.9 kB

Release files / botwrap-0.1.9.tar.gz

Download URL botwrap-0.1.9.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2cb155d4b03d717c6b919d5226d8d4dffc44254f188aab803420cf4e325e74c5
BLAKE2b-256 checksum
How to use checksums
4c85bb402a97853ba248ce17c1615c6ddf92499ed854bce73a45cd668bc54388
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.0

Release files / botwrap-0.1.9-py3-none-any.whl

Download URL botwrap-0.1.9-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4217381ef21a012f84cd7e48e3e26c869f92200be8e2ffa064b2ad53792fdf7d
BLAKE2b-256 checksum
How to use checksums
c9dedc19b9c4295c7f157f0b5f1baecb510f10effd119b2974edd4698e73ebd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page