ai-assistantbot


Nameai-assistantbot JSON
Version 0.0.11 PyPI version JSON
download
home_pagehttps://github.com/wassim-khleifi/ai_assistantbot
SummaryAssistantBot is a python package which provides an question-answering system designed to process large datasets efficiently. It dynamically matches user queries with relevant data, offering accurate responses and easy training process.
upload_time2024-09-11 12:34:01
maintainerNone
docs_urlNone
authorWassim Khleifi
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Assistant AI

Assistant AI is a simple conversational assistant package that uses predefined questions and answers to provide relevant responses. The package also supports training, where you can add new questions and answers dynamically.

## Features

- **Predefined Question & Answer Model**: The assistant can respond to predefined questions using a JSON file.
- **Dynamic Training**: You can train the assistant with new questions and answers.
- **Close Match Question Detection**: Uses `difflib` to match input questions with the closest possible question in the model.
- **Simple and Flexible**: Easy to extend or modify.

## Installation

Clone the repository and navigate to your project folder:

```bash
git clone https://github.com/wassim-khleifi/ai_assistantbot.git
cd ai_assistantbot
```
You can install the package using pip:
```bash
pip install .
```
Or install via pypi:
```bash
pip install ai_assistantbot
```

## Usage:
### Initializing the Assistant:
First, import and initialize the Assistant class with the path to the JSON file that stores the model data:
```py
import ai_assistantbot
from ai_assistantbot import Assistant

# Initialize the assistant with the model JSON file
assistant = Assistant('path_to_your_model.json')

# Register the base model (if not created)
assistant.register()
```
### Query the Assistant:
Use the ``get_answer`` method to fetch answers based on user questions:
```py
response = assistant.get_answer("hi", not_found="Sorry, I don't understand")
print(response)  # Output: Hey there!
```
### Train the Assistant
You can train the assistant by providing new questions and answers:
```py
new_questions = ["how are you", "how's it going"]
new_answers = ["I'm doing great, thanks!", "All good!"]

assistant.train_model(new_questions, new_answers)
```
## Example:
This example is taken from ``examples/example.py``
```py
import ai_assistantbot
from ai_assistantbot.assistant import *
# Initialize the assistant with the model JSON file
assistant = Assistant('example.json')
assistant.register() # Register the base model (if not created)

while True:
	user_input = input('You: ')
	response = assistant.get_answer(str(user_input), not_found="Sorry, I don't understand")
	print('Bot: ' + response)
```
## Contributing:
Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.
## License:
This project is licensed under the MIT License:
```
MIT License

Copyright (c) 2024 Wassim Khleifi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wassim-khleifi/ai_assistantbot",
    "name": "ai-assistantbot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Wassim Khleifi",
    "author_email": "wassimkhleifi@gamil.com",
    "download_url": "https://files.pythonhosted.org/packages/84/19/f6762c90465e6876df36703a85b9d2cfb0a9a2c6238e4fa193178b4c2ecc/ai_assistantbot-0.0.11.tar.gz",
    "platform": null,
    "description": "# Assistant AI\r\n\r\nAssistant AI is a simple conversational assistant package that uses predefined questions and answers to provide relevant responses. The package also supports training, where you can add new questions and answers dynamically.\r\n\r\n## Features\r\n\r\n- **Predefined Question & Answer Model**: The assistant can respond to predefined questions using a JSON file.\r\n- **Dynamic Training**: You can train the assistant with new questions and answers.\r\n- **Close Match Question Detection**: Uses `difflib` to match input questions with the closest possible question in the model.\r\n- **Simple and Flexible**: Easy to extend or modify.\r\n\r\n## Installation\r\n\r\nClone the repository and navigate to your project folder:\r\n\r\n```bash\r\ngit clone https://github.com/wassim-khleifi/ai_assistantbot.git\r\ncd ai_assistantbot\r\n```\r\nYou can install the package using pip:\r\n```bash\r\npip install .\r\n```\r\nOr install via pypi:\r\n```bash\r\npip install ai_assistantbot\r\n```\r\n\r\n## Usage:\r\n### Initializing the Assistant:\r\nFirst, import and initialize the Assistant class with the path to the JSON file that stores the model data:\r\n```py\r\nimport ai_assistantbot\r\nfrom ai_assistantbot import Assistant\r\n\r\n# Initialize the assistant with the model JSON file\r\nassistant = Assistant('path_to_your_model.json')\r\n\r\n# Register the base model (if not created)\r\nassistant.register()\r\n```\r\n### Query the Assistant:\r\nUse the ``get_answer`` method to fetch answers based on user questions:\r\n```py\r\nresponse = assistant.get_answer(\"hi\", not_found=\"Sorry, I don't understand\")\r\nprint(response)  # Output: Hey there!\r\n```\r\n### Train the Assistant\r\nYou can train the assistant by providing new questions and answers:\r\n```py\r\nnew_questions = [\"how are you\", \"how's it going\"]\r\nnew_answers = [\"I'm doing great, thanks!\", \"All good!\"]\r\n\r\nassistant.train_model(new_questions, new_answers)\r\n```\r\n## Example:\r\nThis example is taken from ``examples/example.py``\r\n```py\r\nimport ai_assistantbot\r\nfrom ai_assistantbot.assistant import *\r\n# Initialize the assistant with the model JSON file\r\nassistant = Assistant('example.json')\r\nassistant.register() # Register the base model (if not created)\r\n\r\nwhile True:\r\n\tuser_input = input('You: ')\r\n\tresponse = assistant.get_answer(str(user_input), not_found=\"Sorry, I don't understand\")\r\n\tprint('Bot: ' + response)\r\n```\r\n## Contributing:\r\nContributions are welcome! Please fork this repository, make your changes, and submit a pull request.\r\n## License:\r\nThis project is licensed under the MIT License:\r\n```\r\nMIT License\r\n\r\nCopyright (c) 2024 Wassim Khleifi\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n```\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "AssistantBot is a python package which provides an question-answering system designed to process large datasets efficiently. It dynamically matches user queries with relevant data, offering accurate responses and easy training process.",
    "version": "0.0.11",
    "project_urls": {
        "Homepage": "https://github.com/wassim-khleifi/ai_assistantbot"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c830d625ecd37d3f15474972e9496014ad81e17d993f40e37ca2ed2534d66257",
                "md5": "23f6c71bc7482e4561c0a797a7d6e6a4",
                "sha256": "113be75f79c4dd3a30a73a58edde3d20e17d7fc7575f3e3f63c5fde9f0d5c1d6"
            },
            "downloads": -1,
            "filename": "ai_assistantbot-0.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "23f6c71bc7482e4561c0a797a7d6e6a4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5304,
            "upload_time": "2024-09-11T12:33:59",
            "upload_time_iso_8601": "2024-09-11T12:33:59.968072Z",
            "url": "https://files.pythonhosted.org/packages/c8/30/d625ecd37d3f15474972e9496014ad81e17d993f40e37ca2ed2534d66257/ai_assistantbot-0.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8419f6762c90465e6876df36703a85b9d2cfb0a9a2c6238e4fa193178b4c2ecc",
                "md5": "41813ed31d178e4ae00cbda4c8482a82",
                "sha256": "d8ac2a339f0e26317a421ebd142901167c5175ec4ccfd05bd96ae1834795e1c7"
            },
            "downloads": -1,
            "filename": "ai_assistantbot-0.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "41813ed31d178e4ae00cbda4c8482a82",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4659,
            "upload_time": "2024-09-11T12:34:01",
            "upload_time_iso_8601": "2024-09-11T12:34:01.671026Z",
            "url": "https://files.pythonhosted.org/packages/84/19/f6762c90465e6876df36703a85b9d2cfb0a9a2c6238e4fa193178b4c2ecc/ai_assistantbot-0.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-11 12:34:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wassim-khleifi",
    "github_project": "ai_assistantbot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ai-assistantbot"
}
        
Elapsed time: 1.18150s