Skip to main content

Query documents quickly and efficiently

Project description

Docusearch

Welcome to Docusearch, the ultimate tool for document searching and processing using the power of vector embeddings. Follow the steps below to get started quickly!

Installation

First, you need to install the docusearch package using pip. Installation may take a minute or two. To avoid conflicts, it is recommend you use a virtual environment:

pip install docusearch

Usage

Step 1: Import the Module

After installing the package, import the process_query function from the docusearch module:

from docusearch import process_query

Step 2: Set the Parameters

Define the parameters for your query. You need to set your OpenAI API key, the path to the folder containing the documents, and the query for those documents

query = "What are some cool features of the Audi r8"
api_key = "your-openai-key"
folder_path = "path-to-your-folder"

Step 3: Call the Function and Print the Result

Now, call the process_query function with the parameters you set and print the result:

result = process_query(query, api_key, folder_path)
print(result)

Example

Here is the complete example code:

from docusearch import process_query

query = "What are some cool features of the Audi r8"
api_key = "your-openai-key"
folder_path = "path-to-your-folder"

result = process_query(query, api_key, folder_path)
print(result)

And that's it! You have successfully used the docusearch package to process your query. Enjoy searching your documents with ease!

Additional Info

If you would like specific information about the result, you can use the extract_info function. It will provide you the document source, answer, citations, and warnings for unsupported files.

Import the extract_info Function

from docusearch import extract_info

Use the extract_info function to extract the document source, answer, citations, and any warnings:

document_source, answer, citations, warning = extract_info(result)

print(f"Document Source: {document_source}")
print(f"Answer: {answer}")
print(f"Citations: {citations}")
if warning:
    print(f"Warning: {warning}")

Complete Example

Here is the complete example code to query and extract specific information:

from docusearch import process_query, extract_info

query = "What are some cool features of the Audi r8"
api_key = "your-openai-key"
folder_path = "path-to-your-folder"

# Process the query
result = process_query(query, api_key, folder_path)

# Extract information from the result
document_source, answer, citations, warning = extract_info(result)

# Print the extracted information
print(f"Document Source: {document_source}")
print(f"Answer: {answer}")
print(f"Citations: {citations}")
if warning:
    print(f"Warning: {warning}")

By following these steps, you can easily extract and use specific pieces of information from the result provided by the docusearch package. Have fun!

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

docusearch-0.3.6.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

docusearch-0.3.6-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file docusearch-0.3.6.tar.gz.

File metadata

  • Download URL: docusearch-0.3.6.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0rc1

File hashes

Hashes for docusearch-0.3.6.tar.gz
Algorithm Hash digest
SHA256 fdd27bf798ce9443f92af7046c665087c73c95d481f79d4728a9768f2da73a95
MD5 123c6be189661e4a33bde50bb1956a3c
BLAKE2b-256 1f5e2668d89174615eaf974cb7fbe89cb45682d3d708bd9cff00dedf0a751b7e

See more details on using hashes here.

File details

Details for the file docusearch-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: docusearch-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0rc1

File hashes

Hashes for docusearch-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9e4077964ae5262753acf9697ac9ad330c5a774db80b0b37b2cb3b18fee18e68
MD5 ca1247305e9188af9c2b2cd3d7adde13
BLAKE2b-256 0a6f87ac91fe242b2468aac1aec524312ca36e604ddd7c653850ecd6c5737db3

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