Ai library
Project description
Aiology
This is an easy to use ai communication package which you can easily setting it up and start working with it !!
To download ,and use this package : pip install Aiology
This package includes two modules :
AI
By using this module you can start a text base communication with Gemini ai
By using this module you can extract pdf files text (it works for Persian pdf too !!)
Easy set up
This part depends on your purpose ,for example :
Using PDF module :
This module needs one parameter which is your pdf path :
#import our PDF module
from Aiology import PDF
#specify your pdf location
pdf_path = "YOUR_PDF_PATH"
#set up
pdf = PDF(pdf_path)
Then you can get your pdf content by using these two functions : get_pdf_content get_pdf_page_content
get_pdf_content -> extract all pdf pages content
get_pdf_page_content -> extract specific pdf page content
pdf.get_pdf_content() #will extract all pdf pages content
pdf.get_pdf_page_content() #will extract specific pdf page content
Using AI module :
This module needs one parameter which is your Gemini api key :
#import our AI module
from Aiology import AI
#specify your Gemini api key
api_key = "YOUR_GEMINI_API_KEY"
#set up
ai = AI(api_key)
Then you can start communication by ai by these two functions : ask_question ask_pdf_question
ask_question -> Ask anything you want from Gemini by your api token
ask_pdf_question -> Ask about your pdf content from Gemini by your api token
#ask anything from ai
result = ai.ask_question("YOUR_TEXT_HERE")
#print ai answer
print(result)
If you want to ask ai questions about your pdf file ,you should pass PDF which is represents your pdf data to ask_pdf_question :
NOTE :
ask_pdf_questiontakes 3 arguments :text -> Your text
pdf -> PDF object which represent your pdf data
pdf_page -> You can define a specific pdf page for ai to answer to your questions
#import modules
from Aiology import PDF , AI
#variables
pdf_path = "YOUR_PDF_PATH"
api_key = "YOUR_GEMINI_API_KEY"
#PDF set up
pdf = PDF(pdf_path)
#Ai set up
ai = AI(api_key)
#ask about your pdf content
result = ai.ask_pdf_question("YOUR_TEXT",pdf,1)
#print result
print(result)
Conclusion
This is a powerful ,but small ai package which provide you useful tools
I hope this will be useful for you
Single Star
Seyed Moied Seyedi
Project details
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 aiology-0.0.0.tar.gz.
File metadata
- Download URL: aiology-0.0.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d880f4201b3520e8fbf926108b6a2e3df2b1082f60118f83720e8db50274cf5
|
|
| MD5 |
1f88ed5079fa95634268195275c8b6c6
|
|
| BLAKE2b-256 |
24685b649a8d556dd9a267772ff26ccb186eef3237edd9c62c9d036ec1c00255
|
File details
Details for the file aiology-0.0.0-py3-none-any.whl.
File metadata
- Download URL: aiology-0.0.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a35a9eb5629ade5a39750a351e42deae5cde3d685db39787f3047fbed5c5b0d6
|
|
| MD5 |
410af32d08209b0c1efd51dcb146a34e
|
|
| BLAKE2b-256 |
8ede4b4d5d7deeb8326779d816de1ea7040dfb902f887c9f9a9efd626d271d0c
|