Skip to main content

File search tool using OpenAI assistant.

Project description

File search tools using OpenAI Assistant

Work in progress, still trying polish a few features and getting some initial feedback.

Installation (pip)

pip install lumei

Usage

Example

The following is an example of processing a list of pdf files and extracting the vendor and price data from the files. The command requires an OpenAI API key which can be obtained from here https://platform.openai.com/account/api-keys.

lumei \
  --input-files ~/folder_1/*.pdf,~/folder_2/*.pdf \
  --output-file ~/Desktop/output.json \
  --openai-api-key=<OPENAI_API_KEY> \
  --query="[
  	{'name': 'vendor', 'description': 'Name of the vendor who issued the invoice.'}, 
  	{'name': 'price', 'description': 'Total bill from the invoice.'}
  ]"

Input Parameters

--input-files

Source files to process on. Multiple files can be provided, and they are seperated by a comma "," character. File inputs can be expressed as a path to a single file or a regex.

--output-file

Path of the file that the results will be written to. Input must be a file path to a single file. Supported file formate are ".csv", ".xlsx", and ".json".

--openai-api-key [Optional]

API key for OpenAI, necessary for file search functionalities. Key can be obtained from here https://platform.openai.com/account/api-keys.

Alternative way to provide the API key is to set it as the "OPENAI_API_KEY" environment variable.

--query

Name and description of data to search for. Input should be an array of JSON objects. Name of the data to search for is the key. Name of the data will be the column name for the result dataset. The description of the data to search is the value.

Example:

[
    {
        'name': 'vendor', 
        'description': 'Name of the vendor who issued the invoice.'
    }, 
    {
        'name': 'price', 
        'description': 'Total bill from the invoice.'
    }
]

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

lumei-0.2.7.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

lumei-0.2.7-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file lumei-0.2.7.tar.gz.

File metadata

  • Download URL: lumei-0.2.7.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for lumei-0.2.7.tar.gz
Algorithm Hash digest
SHA256 cee9ac255ac877f5f7a4aff6d2c35b0ba05c3285b882555b776a47554a35e698
MD5 2d6bf6ebdbac6a4603bbf09ad30d7ccc
BLAKE2b-256 361e78c848977faf9a8eb0b1a114c0f8d4ada083b1e07ca7c99f5bfb34485735

See more details on using hashes here.

File details

Details for the file lumei-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: lumei-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for lumei-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 dc2bb7f124aedb14f7ec51ac27e643d79f11f7e7647ca23265981f61cfd2e122
MD5 9ac6fea14bcb1bfca9546a58acb15514
BLAKE2b-256 a32ecd96fea4c97490113d390d2547d7e5bb881cfcb1f2a471c5349ec676ec35

See more details on using hashes here.

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