Skip to main content

AI (LLM)

The AI connector turns unstructured documents — primarily PDFs — into structured JSON that a normal processing class can consume. Instead of classic OCR templates, you describe the document in a plain-language prompt and let a large language model do the extraction.

Framework classes: DEVIntegAIProviderBase (provider contract), DEVIntegAIProviderGemini (Google Gemini implementation), DEVIntegAICallStatistics (token/duration statistics).

How it works

  1. Register a provider in the AI providers form and store the endpoint and API key in a Connection type.
  2. Define and iterate on the extraction prompt in AI prompt definitions — the Call API button tests the prompt on a sample file and shows the response and statistics.
  3. Link the prompt to an Inbound message type whose processing class reads the returned JSON and creates the document via staging tables, with all the standard validation, error handling, and traceability.

The prompt can even implement simple mappings ("if the description is 37' TV, use item T0004"); numeric comparison logic is better kept in X++.

Tutorial