A Python library to answer questions based on given data and additional queries using Gemini.
Project description
PB Assistant Library
Question Assistant is a Python library that uses AI to answer user queries based on custom data or an external AI model when the data is insufficient. It also includes features for recognizing questions about the assistant's name and determining the relevance of a query to the provided data.
Features
- Custom Query Answering: Answers user queries using provided data or Gemini AI.
- Name Recognition: Detects and responds to queries about the assistant's name.
- Data Relevance Check: Identifies whether a query is related to the given data.
- Configurable Assistant: Rename the assistant as needed.
Installation
Install the library via pip:
pip install pb-assistant
Usage
Import and Initialize the Assistant
from pb_assistant import pbAssistant
# Create an assistant instance with a default name
assistant = pbAssistant(name="Assistant")
Changing the Name
assistant.change_name("Alexa")
Running the Main Execution Loop
assistant.main_execution(api_key="your_api_key", data="Your provided data here.")
Example Usage
from pb_assistant import pbAssistant
# Initialize the assistant
assistant = pbAssistant()
# Optionally, rename the assistant
assistant.change_name("Jarvis")
# Run the assistant
assistant.main_execution(api_key="your_api_key", data="Information about Python, AI, and Machine Learning.")
Requirements
- Python 3.7 or higher
google-generativeai(installed automatically with the package)
Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m "Add your feature"). - Push to the branch (
git push origin feature/your-feature). - Open a Pull Request.
For issues or feature requests, feel free to create an issue in the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Priyanshu Bhatt
Feel free to reach out at priyanshubhatt80@gmail.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pb_assistant-1.0.1.tar.gz.
File metadata
- Download URL: pb_assistant-1.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d75b38e6bea195dcbcf25ce77e23ff8ec95f87f64447c4df715d98c39be12b33
|
|
| MD5 |
d143e8f40860ca3b822a26a8cc80cc49
|
|
| BLAKE2b-256 |
1e3c62ec8d97bed21d137cc96c30a94724a58c65b78cf73996f71b668cf603ee
|
File details
Details for the file pb_assistant-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pb_assistant-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59eca41a9d0ae5cc8ae442c7817fc99f25b272a16e011ce7e3dc403d2df06cda
|
|
| MD5 |
52841ba007af04683dff9e7215b2da68
|
|
| BLAKE2b-256 |
8910f2c079389a44a34bd1d4cbcc528d83ceb2eed170f536477f5e3b0d859b09
|