ai-assistant-manager


Nameai-assistant-manager JSON
Version 2.1.0 PyPI version JSON
download
home_pageNone
SummaryThis repository provides tools and services to manage OpenAI Assistants, including creating, listing, and deleting assistants, as well as handling vector stores and retrieval files.
upload_time2024-09-21 04:01:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
license/* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * <jus.beall@gmail.com> wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Justin Lee Beall * ---------------------------------------------------------------------------- */
keywords ai api nlp artificial intelligence assistant automation chatbot data science deep learning machine learning management natural language processing openai python vector store
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # AI Assistant Manager

This repository provides tools and services to manage OpenAI Assistants, including creating, listing, and deleting assistants, as well as handling vector stores and retrieval files. It includes end-to-end and unit tests, and leverages the Hatch build system for environment management and testing.

## Install through PyPI

```bash
pip install ai-assistant-manager
```

For more details, visit the [PyPI project page](https://pypi.org/project/ai-assistant-manager/).

## Setup

1. Clone the repository:

```bash
git clone https://github.com/DEV3L/ai-assistant-manager
cd ai-assistant-manager
```

2. Copy the env.local file to a new file named .env and replace `OPENAI_API_KEY` with your actual OpenAI API key:

```bash
cp env.local .env
```

3. Setup a virtual environment with dependencies and activate it:

```bash
brew install hatch
hatch env create
hatch shell
```

## Environment Variables

The following environment variables can be configured in the `.env` file:

- `OPENAI_MODEL`: The model to use (default: `gpt-4o-2024-08-06`)
- `ASSISTANT_DESCRIPTION`: Description of the assistant (default: `AI Assistant Manager`)
- `ASSISTANT_NAME`: Name of the assistant (default: `AI Assistant Manager`)
- `BIN_DIR`: Directory for binaries (default: `bin`)
- `DATA_DIR`: Directory for data files (default: `data`)
- `DATA_FILE_PREFIX`: Prefix for data files (default: `AI Assistant Manager`)

## Testing

### End to End Test

```bash
hatch run e2e
```

### Unit Tests

```bash
hatch run test
```

### Coverage Gutters:

```bash
Command + Shift + P => Coverage Gutters: Watch
```

## Example

```
from loguru import logger

from ai_assistant_manager.assistants.assistant_service import (
    AssistantService,
)
from ai_assistant_manager.chats.chat import Chat
from ai_assistant_manager.clients.openai_api import OpenAIClient, build_openai_client
from ai_assistant_manager.env_variables import set_env_variables
from ai_assistant_manager.exporters.directory.directory_exporter import DirectoryExporter
from ai_assistant_manager.exporters.files.files_exporter import FilesExporter
from ai_assistant_manager.prompts.prompt import get_prompt


def main():
    DirectoryExporter("directory").export()
    FilesExporter("about.txt").export()

    assistant_name = "AI-Assistant-Manager-Test"
    logger.info(f"Building {assistant_name}")

    client = OpenAIClient(build_openai_client())
    service = AssistantService(client, get_prompt())

    logger.info("Removing existing assistant and category files")
    service.delete_assistant()

    assistant_id = service.get_assistant_id()
    logger.info(f"Assistant ID: {assistant_id}")

    chat = Chat(client, assistant_id)
    chat.start()

    message = "What is the AI Assistant Manager?"
    print(f"\nMessage:\n{message}")

    chat_response = chat.send_user_message(message)
    print(f"\n{service.assistant_name}:\n{chat_response.message}")
    print(f"\nTokens: {chat_response.token_count}")

    // service.delete_assistant()


if __name__ == "__main__":
    try:
        set_env_variables()
        main()
    except Exception as e:
        logger.info(f"Error: {e}")
```

## Contributing

We welcome contributions! To contribute:

1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Make your changes.
4. Ensure all tests pass.
5. Submit a pull request with a detailed description of your changes.

## Code of Conduct

We expect all contributors to adhere to our Code of Conduct:

- Be respectful and considerate.
- Avoid discriminatory or offensive language.
- Report any unacceptable behavior to the project maintainers.

By participating in this project, you agree to abide by these guidelines.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ai-assistant-manager",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "AI, API, NLP, artificial intelligence, assistant, automation, chatbot, data science, deep learning, machine learning, management, natural language processing, openai, python, vector store",
    "author": null,
    "author_email": "Justin Beall <jus.beall@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/9e/2d/b8abf220cc2bd69e546e79add1d407c3add14f2d25ae97a00c6afa37b4e2/ai_assistant_manager-2.1.0.tar.gz",
    "platform": null,
    "description": "# AI Assistant Manager\n\nThis repository provides tools and services to manage OpenAI Assistants, including creating, listing, and deleting assistants, as well as handling vector stores and retrieval files. It includes end-to-end and unit tests, and leverages the Hatch build system for environment management and testing.\n\n## Install through PyPI\n\n```bash\npip install ai-assistant-manager\n```\n\nFor more details, visit the [PyPI project page](https://pypi.org/project/ai-assistant-manager/).\n\n## Setup\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/DEV3L/ai-assistant-manager\ncd ai-assistant-manager\n```\n\n2. Copy the env.local file to a new file named .env and replace `OPENAI_API_KEY` with your actual OpenAI API key:\n\n```bash\ncp env.local .env\n```\n\n3. Setup a virtual environment with dependencies and activate it:\n\n```bash\nbrew install hatch\nhatch env create\nhatch shell\n```\n\n## Environment Variables\n\nThe following environment variables can be configured in the `.env` file:\n\n- `OPENAI_MODEL`: The model to use (default: `gpt-4o-2024-08-06`)\n- `ASSISTANT_DESCRIPTION`: Description of the assistant (default: `AI Assistant Manager`)\n- `ASSISTANT_NAME`: Name of the assistant (default: `AI Assistant Manager`)\n- `BIN_DIR`: Directory for binaries (default: `bin`)\n- `DATA_DIR`: Directory for data files (default: `data`)\n- `DATA_FILE_PREFIX`: Prefix for data files (default: `AI Assistant Manager`)\n\n## Testing\n\n### End to End Test\n\n```bash\nhatch run e2e\n```\n\n### Unit Tests\n\n```bash\nhatch run test\n```\n\n### Coverage Gutters:\n\n```bash\nCommand + Shift + P => Coverage Gutters: Watch\n```\n\n## Example\n\n```\nfrom loguru import logger\n\nfrom ai_assistant_manager.assistants.assistant_service import (\n    AssistantService,\n)\nfrom ai_assistant_manager.chats.chat import Chat\nfrom ai_assistant_manager.clients.openai_api import OpenAIClient, build_openai_client\nfrom ai_assistant_manager.env_variables import set_env_variables\nfrom ai_assistant_manager.exporters.directory.directory_exporter import DirectoryExporter\nfrom ai_assistant_manager.exporters.files.files_exporter import FilesExporter\nfrom ai_assistant_manager.prompts.prompt import get_prompt\n\n\ndef main():\n    DirectoryExporter(\"directory\").export()\n    FilesExporter(\"about.txt\").export()\n\n    assistant_name = \"AI-Assistant-Manager-Test\"\n    logger.info(f\"Building {assistant_name}\")\n\n    client = OpenAIClient(build_openai_client())\n    service = AssistantService(client, get_prompt())\n\n    logger.info(\"Removing existing assistant and category files\")\n    service.delete_assistant()\n\n    assistant_id = service.get_assistant_id()\n    logger.info(f\"Assistant ID: {assistant_id}\")\n\n    chat = Chat(client, assistant_id)\n    chat.start()\n\n    message = \"What is the AI Assistant Manager?\"\n    print(f\"\\nMessage:\\n{message}\")\n\n    chat_response = chat.send_user_message(message)\n    print(f\"\\n{service.assistant_name}:\\n{chat_response.message}\")\n    print(f\"\\nTokens: {chat_response.token_count}\")\n\n    // service.delete_assistant()\n\n\nif __name__ == \"__main__\":\n    try:\n        set_env_variables()\n        main()\n    except Exception as e:\n        logger.info(f\"Error: {e}\")\n```\n\n## Contributing\n\nWe welcome contributions! To contribute:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bugfix.\n3. Make your changes.\n4. Ensure all tests pass.\n5. Submit a pull request with a detailed description of your changes.\n\n## Code of Conduct\n\nWe expect all contributors to adhere to our Code of Conduct:\n\n- Be respectful and considerate.\n- Avoid discriminatory or offensive language.\n- Report any unacceptable behavior to the project maintainers.\n\nBy participating in this project, you agree to abide by these guidelines.\n",
    "bugtrack_url": null,
    "license": "/* * ---------------------------------------------------------------------------- * \"THE BEER-WARE LICENSE\" (Revision 42): * <jus.beall@gmail.com> wrote this file.  As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return.   Justin Lee Beall * ---------------------------------------------------------------------------- */",
    "summary": "This repository provides tools and services to manage OpenAI Assistants, including creating, listing, and deleting assistants, as well as handling vector stores and retrieval files.",
    "version": "2.1.0",
    "project_urls": {
        "repository": "https://github.com/DEV3L/open-ai-assistant"
    },
    "split_keywords": [
        "ai",
        " api",
        " nlp",
        " artificial intelligence",
        " assistant",
        " automation",
        " chatbot",
        " data science",
        " deep learning",
        " machine learning",
        " management",
        " natural language processing",
        " openai",
        " python",
        " vector store"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dab5961588cd5e4d41b2e2b89f8ec7d80d245c962d4e3c91564b9fb4b8efe34c",
                "md5": "0c57a0b0357469ac39fd2188a99a9c7d",
                "sha256": "31f39219f19d88206da4b1de0d7ef2a750aa69ac07278ff98dac3d1ef477e274"
            },
            "downloads": -1,
            "filename": "ai_assistant_manager-2.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0c57a0b0357469ac39fd2188a99a9c7d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 26262,
            "upload_time": "2024-09-21T04:01:33",
            "upload_time_iso_8601": "2024-09-21T04:01:33.909071Z",
            "url": "https://files.pythonhosted.org/packages/da/b5/961588cd5e4d41b2e2b89f8ec7d80d245c962d4e3c91564b9fb4b8efe34c/ai_assistant_manager-2.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e2db8abf220cc2bd69e546e79add1d407c3add14f2d25ae97a00c6afa37b4e2",
                "md5": "2bd71a0c8e8bf5b49229078968a60447",
                "sha256": "ce32136503234c4fe2945adab6f18ef6f2e4dde6e9c526578e0a6ef6f67fe7a5"
            },
            "downloads": -1,
            "filename": "ai_assistant_manager-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2bd71a0c8e8bf5b49229078968a60447",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 17480,
            "upload_time": "2024-09-21T04:01:35",
            "upload_time_iso_8601": "2024-09-21T04:01:35.427977Z",
            "url": "https://files.pythonhosted.org/packages/9e/2d/b8abf220cc2bd69e546e79add1d407c3add14f2d25ae97a00c6afa37b4e2/ai_assistant_manager-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-21 04:01:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DEV3L",
    "github_project": "open-ai-assistant",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "ai-assistant-manager"
}
        
Elapsed time: 0.57891s