AI Document Processing for the Form.io UAG
257
The Form.io UAG with the official document plugins, ready for the AI Document component:
| Plugin | What it does |
|---|---|
document:extract (@formio/uag-extract) | The parts of the documents the instructions ask for, in their exact wording, checked against the documents' text. |
document:analyze (@formio/uag-analyze) | Content about the documents: summaries, assessments, comparisons. |
document:translate (@formio/uag-translate) | The documents in the language the form designer picks, keeping their structure. |
converter:office-text (@formio/uag-convert-office) | Word files as Markdown, Excel files as CSV. |
Beside the UAG's built-in converters (PDF text, text files, images as PDF). No system packages are added to the UAG image.
docker run -p 3200:3200 --env-file .env formio/uag-documents
Configure it as the UAG (PROJECT, PROJECT_KEY or ADMIN_KEY, JWT_SECRET, UAG_ENGINES and the engine's key, LICENSE_KEY), and see the UAG's AI Document and Plugins pages for the component and its settings (DOCUMENTS_*, EXTRACT_*).
The image loads /app/plugins/index.mjs. Mount a folder there with an index.mjs that lists the official plugins and your own; the official packages are installed in /app/node_modules, so a mounted folder still imports them:
// plugins/index.mjs
import extract from '@formio/uag-extract';
import analyze from '@formio/uag-analyze';
import translate from '@formio/uag-translate';
import office from '@formio/uag-convert-office';
import sampleText from './uag-convert-sample/index.mjs';
export default [extract, analyze, translate, office, sampleText];
docker run -p 3200:3200 --env-file .env -v "$PWD/plugins:/app/plugins" formio/uag-documents
A plugin's own npm dependencies go in the folder's node_modules (run npm install in the folder), where its imports resolve first. The example converter in examples/uag-convert-sample of the uag-plugins repository is the starting point for writing one. UAG_PLUGINS names another plugins file; UAG_PLUGINS=off loads none.
A plugin that needs system packages (an OCR engine, an office suite) is added by building your own image:
FROM formio/uag-documents
RUN apk add --no-cache tesseract-ocr
COPY plugins /app/plugins
Plugins are trusted code. They run in the UAG process, with its secrets: engine API keys, the project or admin key, the JWT secret. Mounting a plugins folder is installing software: mount only plugins you trust.
docker build -f images/uag-documents/Dockerfile --build-arg UAG_IMAGE=formio/uag:<release> -t formio/uag-documents .
UAG_IMAGE=formio/uag:<release> sh images/uag-documents/test.sh
The test starts the image against a stand-in Form.io project with the stub engine (UAG_ENGINES=stub-agent), sends a generated Word file through the process route and checks that office-text read it, and sends a text file through translate.
Content type
Image
Digest
sha256:c3008b7a8…
Size
12.3 MB
Last updated
3 days ago
docker pull formio/uag-documents:1