Skip to main content

pdfgpt is a Python package that provides users with the ability to engage in natural language conversations with their PDF documents.

Project description

pdfgpt

https://img.shields.io/pypi/v/pdfgpt.svg Documentation Status Downloads Downloads

pdfgpt is a Python package that provides users with the ability to engage in natural language conversations with their PDF documents.

Source: Openai - https://github.com/openai/openai-cookbook

How to install

Environments -> base (root) -> open terminal -> pip install pdfgpt

  • pip install pdfgpt

Example

from pdfgpt import *

d = PDFBot(openai_key='OPENAI_KEY')

print('Example')
extracted_text, num_pages = d.generateText(file_path='tests/epanet_matlab_toolkit.pdf')
df = d.generateEmbeddings(extracted_text)

print('USER: What is EPANET?')
prompt = d.generatePrompt(df, num_pages, 'What is EPANET?')
response = d.sendPrompt(prompt, model="gpt-3.5-turbo")
print('AI')
print(response, '\n')

What is EPANET?

EPANET is a software for modeling water distribution systems’ hydraulic and quality dynamics, initially developed by the US Environmental Protection Agency in the C programming language in 1994. It uses a geometric representation of the pipe network, along with a set of initial conditions, rules of operation, and uses this information to compute flows, pressures, and water quality throughout the network, for a certain period of time.

print('USER: Give me the command to load a network?')
prompt = d.generatePrompt(df, num_pages, 'Give me the command to load a network?')
response = d.sendPrompt(prompt, model="gpt-3.5-turbo", temperature=0.9)
print('AI')
print(response)

What is the command to load a network?

The command to load a network is:

G = epanet( ’BWSN_Network_1 .inp’);%Load EPANET Input file

G.loadMSXFile( ’Arsenite .msx’);%Load MSX file

Features

  • TODO

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2023-05-11)

  • First release on PyPI.

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

pdfgpt-0.2.2.tar.gz (3.3 MB view hashes)

Uploaded Source

Supported by

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