Connectors

Contact support

Helpdesk portal

Google Cloud Document AI - Getting started in Peliqan

Google Cloud Document AI - Getting started in Peliqan

Google Cloud (GCP) Document AI allows you to create document processors that help automate tedious tasks, improve data extraction, and gain deeper insights from unstructured or structured document information. Document AI helps developers create high-accuracy processors to extract, classify, and split documents.

This guide provides an overview of setting up the Google Cloud Document AI Connector in Peliqan. For technical assistance or custom integration requirements, please contact our support team.

Setup

Perform these steps:

Example script

google_document_ai_api = pq.connect('Google Document AI')

import base64
import requests

allowed_upload_file_type = 'pdf'
uploaded_file = st.file_uploader(f"Upload {allowed_upload_file_type} file", accept_multiple_files=False, type=[allowed_upload_file_type])

if uploaded_file is not None:
    file_contents = uploaded_file.read()
    file_base64 = base64.b64encode(file_contents).decode('utf-8')

    params = {
        'base64_content': file_base64,
        'mimetype': "application/pdf"
    }
    
    result = google_document_ai_api.get('process_document', params)
    st.json(result)