Skip to main content

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

PDF

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 two parameters which is your Gemini api key , and use_for_telegram:

[!NOTE]

use_for_telegram -> This argument isn't crucial , if you use this module for telegram bot you should set it as

True ,otherwise it's False as default

#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_question takes 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)

What's new ?

We fixed an important error We fixed PDF module console print bug We add telegram bot usage option in AI part

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

aiology-0.0.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiology-0.0.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file aiology-0.0.2.tar.gz.

File metadata

  • Download URL: aiology-0.0.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for aiology-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c392bd6977633f4dfef8e36c98d3127236e9d857601d4ad6b0a21a5af6cbb658
MD5 8feeb8a64bfd8695e34bb3b8ec44ec96
BLAKE2b-256 2b56b9c3d2d104728b450b21e199e9d521455cf0a1d77abecf26f81f86821482

See more details on using hashes here.

File details

Details for the file aiology-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: aiology-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for aiology-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9590b6521b731bdeb416e832fecd8ef2be216615a509266cd9b75b1121901826
MD5 c30e7379213c1b174d067925e261928b
BLAKE2b-256 49629f3098357ab8f86f2356ad9e625e323c8a7c621ed045e229f36ac14fd3f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page